Author Topic: Choosing an engine for a game  (Read 5227 times)

pullo

  • Guest
Choosing an engine for a game
« on: 4 November 2009, 23:26:51 »
Hi, my first post here.
I’m doing a real-time strategy game for my final year project and currently I’m looking for suitable game engines.
The game idea that I have in mind will require a lot of extra features to be added to this engine and I’m trying to decide whether it’s even technically feasible taking into account that Glest is already a very complex engine.

So the following features may not make any sense now but it’s only because I have a very specific game and they do fit it perfectly.

1)   All of the units of one of the factions will have a limited lifespan. A unit’s HP will decrease over time until it dies. The rate at which HP decreases will depend on what surface this unit is standing and I don’t mean grass/sand etc, each ‘square’ will have its hidden value that will determine the rate of decrease. Also note that units will have its max total HP decreased, i.e. if unit has 250/250 HP now then after say 10min it gets down to 200/200 HP. Or if 100/200 -> 50/100 etc.
2)   Units of other faction are battery powered and they get discharged. The rate of discharge depends on the current action (idle, movement, shooting etc.). The battery can be recharged by standing close to a special building.
3)   Each of the factions will have its special units with special abilities like going invisible for example.
4)   Some units should be able to divide itself forming two units.
5)   In one of the factions a worker does not build a building, it becomes a building.

Of course, I’m not asking you to help me with implementing these features I just want to know preferably from someone who is involved in developing the engine whether it’s technically practical within realistic timeframe of about 4-5 months. I have an average programming abilities just like any other 4th year Computer Science Student and I mainly have experience in Java and C# and a lot less in C++ but I don’t think that this is an issue though.

ElimiNator

  • Airship
  • ********
  • Posts: 3,391
  • The MegaGlest Moder.
    • View Profile
Re: Choosing an engine for a game
« Reply #1 on: 5 November 2009, 05:08:18 »
I think that it is possible some thing can be done already,

#1    You can make units have regain -1, -2, -3, ... HP so it slowly or fast decreases.

#2    ???

#3    Depends on the special ability, but for going invisible you can make it morph into a small unit with no model.

#4    ???

#5    Yes he can morph into a building.
Get the Vbros': Packs 1, 2, 3, 4, and 5!

pullo

  • Guest
Re: Choosing an engine for a game
« Reply #2 on: 5 November 2009, 10:39:22 »
Hi, thanks for the answer ElimiNator.
Re 2): Suppose a unit gets an extra parameter that decreases over time at a certain rate a second depending on what unit is doing i.e say 10 units a second if unit is idle, 50 units if it's moving etc. Then once the parameter falls to 0 unit should 'switch off'.
Re 4): Some of the units should be able 'to split' into two. ie. being able to copy itself.

I know I should have just looked into the code and specs myself but I'm so busy with other coursework that just dont have time.

-Archmage-

  • Moderator
  • Dragon
  • ********
  • Posts: 5,887
  • Make it so.
    • View Profile
    • My Website
Re: Choosing an engine for a game
« Reply #3 on: 5 November 2009, 12:46:39 »
Quote
#1    You can make units have regain -1, -2, -3, ... HP so it slowly or fast decreases.

#1:   Yes, but they do not die when their HP gets to 0 it simply goes negative................



Quote
#3    Depends on the special ability, but for going invisible you can make it morph into a small unit with no model.

#3:   Then you can't select it.



Quote
#5    Yes he can morph into a building.

Are you sure??



Quote
Suppose a unit gets an extra parameter that decreases over time at a certain rate a second depending on what unit is doing i.e say 10 units a second if unit is idle, 50 units if it's moving etc. Then once the parameter falls to 0 unit should 'switch off'.

What is the point of this extra parameter?



Quote
Re 4): Some of the units should be able 'to split' into two. ie. being able to copy itself.

Well you could have a unit produce itself...........but I don't think that would be a very good solution....
Egypt Remastered!

Proof: Owner of glest@mail.com

pullo

  • Guest
Re: Choosing an engine for a game
« Reply #4 on: 5 November 2009, 13:13:37 »
Quote
What is the point of this extra parameter?

Quote
#1:   Yes, but they do not die when their HP gets to 0 it simply goes negative................

Yea I know these features appear to be pointless but they will make sense once the game is complete.
I dont mind modifying a lot of the source code to implement these features, I just want to know how flexible it is?

-Archmage-

  • Moderator
  • Dragon
  • ********
  • Posts: 5,887
  • Make it so.
    • View Profile
    • My Website
Re: Choosing an engine for a game
« Reply #5 on: 5 November 2009, 13:19:43 »
Then talk to the GAE team they would know.
Egypt Remastered!

Proof: Owner of glest@mail.com

wciow

  • Behemoth
  • *******
  • Posts: 968
    • View Profile
Re: Choosing an engine for a game
« Reply #6 on: 5 November 2009, 13:38:44 »
This should be moved to the GAE section. The GAE programmers will be able to better answer you questions and point you in the correct direction regarding which modules/functions to look into and which to avoid.

From my limited programming experience I don't think your changes will be that difficult to implement. Numbers 2 and 5 are afaik already possible.
Check out my new Goblin faction - https://forum.megaglest.org/index.php?topic=9658.0

pullo

  • Guest
Re: Choosing an engine for a game
« Reply #7 on: 5 November 2009, 14:20:51 »
ok, can mods please move this to the appropriate section? thanks

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Choosing an engine for a game
« Reply #8 on: 5 November 2009, 19:38:55 »
Hi Pullo,

1)   All of the units of one of the factions will have a limited lifespan. A unit’s HP will decrease over time until it dies. The rate at which HP decreases will depend on what surface this unit is standing and I don’t mean grass/sand etc, each ‘square’ will have its hidden value that will determine the rate of decrease. Also note that units will have its max total HP decreased, i.e. if unit has 250/250 HP now then after say 10min it gets down to 200/200 HP. Or if 100/200 -> 50/100 etc.

This will obviously need to be coded in, but it wouldn't be overly difficult. The max-hp would need to be moved or duplicated to the Unit class though, Glest uses the Flyweight pattern for game objects (including units), so max-hp is stored in the UnitType class, not Unit.

Quote from: pullo
2)   Units of other faction are battery powered and they get discharged. The rate of discharge depends on the current action (idle, movement, shooting etc.). The battery can be recharged by standing close to a special building.

EP provides the mechanism for requiring 'power', to get it to recharge only if within the vicinity of a certain building will require some code.

Quote from: pullo
3)   Each of the factions will have its special units with special abilities like going invisible for example

Invisible/Cloaked units would probably be the toughest thing on your list to implement.  I can't really comment on the graphical side of things, not my area of expertise :)

Quote from: pullo
4)   Some units should be able to divide itself forming two units.

This should be easy enough to implement, either as a new command in it's own right, or by chaining a produce and morph command together.

Quote from: pullo
5)   In one of the factions a worker does not build a building, it becomes a building.

Morph command will do this for you out of the box.

Quote from: pullo
Of course, I’m not asking you to help me with implementing these features I just want to know preferably from someone who is involved in developing the engine whether it’s technically practical within realistic timeframe of about 4-5 months. I have an average programming abilities just like any other 4th year Computer Science Student and I mainly have experience in Java and C# and a lot less in C++ but I don’t think that this is an issue though.

I think you should be able to get it done. The only one I'd be unsure about is the invisible units, the rest I think could be whipped up rather quickly... of course I'm already quite familiar with the engine :)
Ultimately it would probably come down to how much time you had to explore the codebase.  That said, I'd be happy to provide what pointers I can if you did decide to use Glest.

Either way, best of luck!
Glest Advanced Engine - Code Monkey

Timeline | Downloads

pullo

  • Guest
Re: Choosing an engine for a game
« Reply #9 on: 5 November 2009, 19:58:05 »
Thanks silnarm and everyone else. I'll be definitely looking into the code now to see what can I do.
Regarding the invisibility. The unit will only become invisible to the enemy with a special command, a player will still be able see it. Obviously a unit in the invisible mode should be presented differently graphically, but not completely invisible because a player should still be able to select it etc.

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: Choosing an engine for a game
« Reply #10 on: 5 November 2009, 21:02:14 »
EP provides the mechanism for requiring 'power', to get it to recharge only if within the vicinity of a certain building will require some code.
Shouldn't emanations be able to take care of that?  I know EP regen is one of the things they're supposed to be able to effect.  Admittedly, it would be a property of the building instead of the unit being recharged, but the effect would be the same (I think).
Regarding the invisibility. The unit will only become invisible to the enemy with a special command, a player will still be able see it. Obviously a unit in the invisible mode should be presented differently graphically, but not completely invisible because a player should still be able to select it etc.
If you figure out a way to do it, please share it with us.  Some of us have been waiting for an invisibility feature for a while. :)

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Choosing an engine for a game
« Reply #11 on: 8 November 2009, 11:15:25 »
EP provides the mechanism for requiring 'power', to get it to recharge only if within the vicinity of a certain building will require some code.
Shouldn't emanations be able to take care of that?  I know EP regen is one of the things they're supposed to be able to effect.  Admittedly, it would be a property of the building instead of the unit being recharged, but the effect would be the same (I think).
Well, that wouldn't be reliable because it affects all units. I'll assume that perhaps you only want SOME units to gain this battery energy, so you could add an extra tag for that.

Splitting a unit in two would probably be best done with a (slightly) modified produce command, where it produces the exact same unit that you currently have, and either passes on the same stats, splits the stats, or whatever you wanted the stats to work out to when cloning/splitting.

Invisibility will be easiest if the player can see the unit, but it just has some method of transparency filter, such as making the model 50% transparent, but simply not rendering it on other player's screens (or rendering a mostly transparent, ie: 85% alpha version). And modifying the AI to check if the unit is invisible, and to ignore it if so. Of that, the transparency filter is probably the hardest, but not at all impossible...
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

pullo

  • Guest
Re: Choosing an engine for a game
« Reply #12 on: 11 November 2009, 21:25:33 »
I'm trying to get VS project files from http://glest.codemonger.org but it seems that it's down. Is there an alternative source?

hailstone

  • GAE Team
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: Choosing an engine for a game
« Reply #13 on: 11 November 2009, 21:30:16 »
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

pullo

  • Guest
Re: Choosing an engine for a game
« Reply #14 on: 11 November 2009, 21:37:49 »
Try http://sourceforge.net/projects/glestae/

I think this one only contains the sources for GAE, while I was looking for the project files for Glest (to make it work in Visual Studio).
Also, do I need to install some software to check out sources from repository?

hailstone

  • GAE Team
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: Choosing an engine for a game
« Reply #15 on: 11 November 2009, 22:56:35 »
You could have a look at http://sourceforge.net/projects/glest/ but I didn't see any project files.

You will need a subversion client. I like tortoise svn.
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

pullo

  • Guest
Re: Choosing an engine for a game
« Reply #16 on: 11 November 2009, 23:47:25 »
You could have a look at http://sourceforge.net/projects/glest/ but I didn't see any project files.

You will need a subversion client. I like tortoise svn.

I was just following this tutorial: https://forum.megaglest.org/index.php?topic=3271.0 and it requires some files to be downloaded.
What do you usually use for compaling and editing?

hailstone

  • GAE Team
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: Choosing an engine for a game
« Reply #17 on: 12 November 2009, 05:49:32 »
It's a lot simpler than that if you use the existing project files in the gae repository.

Simplified steps:
1. get data, source and deps from sourceforge
2. extract them all
3. open project files with Microsoft Visual Studio 2008 (or VC++ 2008 Express)
4. Compile both projects
5. Copy exe to data folder

An "official" work-in-progress guide at https://docs.megaglest.org/GAE/Compiling#Windows
« Last Edit: 18 June 2016, 14:50:10 by filux »
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

pullo

  • Guest
Re: Choosing an engine for a game
« Reply #18 on: 12 November 2009, 12:32:35 »
I've downloaded the gae source but it doesnt complile. The problem lies with xercesc xml parser. I downloaded it, extracted and set the system variable to point to bin folder like instructed on xercesc website.
It still woudnt comple because VS wasnt able to find the include files so I had to specify an absolute path to where i installed them. Now I'm getting the following error:
"1>c:\glest\glestae_source_0.2.7\source\shared_lib\sources\xml\xml_parser.cpp(90) : error C2065: 'DOMBuilder' : undeclared identifier" i.e. it doesnt recognize DOMBuilder class.

pullo

  • Guest
Re: Choosing an engine for a game
« Reply #19 on: 12 November 2009, 15:46:39 »
it's ok i found the problem, i shoud have used the olfer version of xercesc. now it works

hailstone

  • GAE Team
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
Re: Choosing an engine for a game
« Reply #20 on: 13 November 2009, 00:33:47 »
We fixed that in later versions and have now removed it entirely with TinyXML. Try 0.2.12a
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

pullo

  • Guest
Re: Choosing an engine for a game
« Reply #21 on: 13 November 2009, 18:56:52 »
hi. i've got 0.2.12a via svn and it compiled straght away with less warnings but when i put it into the data folder it starts and then crashes 1 sec later. It creates a few log files but nothing in them.
0.2.12 that i downloaded from sourceforge doesnt crash.

-Archmage-

  • Moderator
  • Dragon
  • ********
  • Posts: 5,887
  • Make it so.
    • View Profile
    • My Website
Re: Choosing an engine for a game
« Reply #22 on: 13 November 2009, 19:22:02 »
Yea, 0.2.12a seems to crash with no errors right after you start it.
Egypt Remastered!

Proof: Owner of glest@mail.com

pullo

  • Guest
Re: Choosing an engine for a game
« Reply #23 on: 13 November 2009, 22:44:22 »
Yea, 0.2.12a seems to crash with no errors right after you start it.
so is it possible to fix it?

-Archmage-

  • Moderator
  • Dragon
  • ********
  • Posts: 5,887
  • Make it so.
    • View Profile
    • My Website
Re: Choosing an engine for a game
« Reply #24 on: 13 November 2009, 22:52:35 »
Since we can't seem to get an error, I don't know if it can be fixed.
Egypt Remastered!

Proof: Owner of glest@mail.com