Jump to content
  • Advertisement
Sign in to follow this  
Techieman

Game Object Architecture for RTS

This topic is 1057 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,

my current project is a rts game using my own game engine (C++, OpenGL 4.2).

My game engine doesn't provide its own game object architecture because I wanted to try different approaches.

However, a rts game is yet different again. I'm tending to use a property-centric architecture since all units have mostly everything in common.

For example those properties: HP, Mana, Mesh, CollisionBoundary and so on.

 

But I need it to be extensible through scipts. I am going to add hell a lot of units (let alone be the human race with around 50 units).

Is an property-centric suitable for a rts game or does there exist another approach (other than ECS), which supports data locailty?

 

 

Share this post


Link to post
Share on other sites
Advertisement

What exactly is your question?

 

ECS should lend itself well to data oriented design if that is what you wanted to ask.

Share this post


Link to post
Share on other sites

Well what have you tried so far?

 

I would say that the ecs approach is a good fit.

It lets you easily mix different behaviours to make the units relatively unique without requiring you to write hundreds of specialized classes. (at least in theory)

Share this post


Link to post
Share on other sites

I'm tending to use a property-centric architecture since all units have mostly everything in common.
For example those properties: HP, Mana, Mesh, CollisionBoundary and so on.

that's a good starting point, you can describe all units in an RTS with the same properties. buildings can be the same objects but with a "max-speed" of 0. tanks and soldiers are the same with different speeds and fire power.
you can set 'flags' for special needs like e.g. ammo type, some units might fire arrows, others cannonballs, which look and move differently, but those have still the same property types (damage-per-hit,speed,fire-delay,precision,....)

that will also make scripting very simple, as you just have one type of object to cover and you can script everything you want with every unit. e.g. if you have an "on-hit" bool that indicates whether the unit explodes when it hits something (e.g. cannon-ball), you could switch on this flag for a jeep via script and call it a suicide vehicle that the player needs to stop before it reaches base....

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!