12 years ago

Abstracting Visuals From Game Objects


To preface this, I have to mention that I don’t write game that use 3D models in them. I also generally don’t write games that have much of anything that could be called physics.

I write games that exist on a virtual board, rigidly organized into cells, be they rectangular, isometric, or hexagonal. Almost always, the game objects exist within the cells. Occasonally, they exist on the common edge between cells.

Because of this, I have long since abstracted my drawing code from my game code. I have noticed a lot of developers, especially early on, tend to think of the sprite or whatever they are using as “The Thing” (game object). It is not the thing. It is how The Thing looks when it is rendered on the screen.

Even in the cases where this actually appears to be so (i.e. in 3D model land and in 2d sprite shmups with pixel perfect collision detection), the graphic of The Thing is not The Thing. The geometries for collision detection are important aspects of The Thing and key to how it interacts in the world, but the same could be represented in an untextured 3d model(or more commonly a hitbox) or a monochrome bitmask.(or 2d hitbox)

The graphics of The Thing are not The Thing.

So what?

The ramifications of the graphics not being The Thing are profound. If you do it right, you can write the game code that deals with your game objects to be separate from the rendering code. Replace the rendering module, and you’ve got a new way of seeing your game without changing a bit of the back end code.

This is exactly what things like LibGDX does, but it isn’t really as noticible since all of the rendering platforms use OpenGL. OpenGL is another good example of something that does this. It takes abstracted geometry and renders it on screen.



0 comments

Loading...

Next up

"Thanks guys for endless hours of fun." 👍

(My first fan art. Read the article, please.)

#sonic #mario #photoshop

Enemies can also suddenly spawn through Realm Rifts. These Rift Spawns are going to be stronger than the ones wandering around. TBD on the enemies... #screenshotsaturday #godstear #madewithunity

Today I was setting up the location of the first boss. His name is "Father" and he is the first of the Patagonians. His task is to guard the road to the House.🛡🗡 Bookmark pre-launch page🔖🔖🔖

https://www.kickstarter.com/projects/rdvindiegame/the-patagonian…

I was bored, so... ManutKat.

Finished work on the emotions of a new character for the tank universe

Hi everyone! I started to create some environment props for my new video game, here is a cozy house in the forest. I'm planning to switch from Unity to Unreal... Let's see what new challenges I have to face. Made in Blender and Substance Painter.

Terraria

Showing off player 2 😎

What do you think?

Regular exercise is key for healthy wings.

Try it out!

https://gamejolt.com/games/AeonNightmares/605184

Today I tackled drawing different variations of facial expressions for one of the main characters in Eden. What do you think of it? :) Eden: https://gamejolt.com/games/Eden/592698