Page 1 of 1

Units Customization

Posted: 30 Dec 2011, 06:06
by Zguba
Hi Guys,

I'm doing slowly a little game.

As you can see in the topic name I have idea to put into my game unit customization. f.e.:

choose base (let we say: tank)
choose heavy weapon slot1 (heavy cannon - with another free small slot on the top, which could be added)
save it, and start producing.

Of course this must be made on user-friendly panel.

I'm not asking for doing this for me, but maybe a bit of hints, or it is possible to do? I search a forum a bit, but I didn't see anyone with this idea (or I just don't know how to search correctly :P).

Re: Units Cstomization

Posted: 30 Dec 2011, 06:41
by maackey
AFAIK units can't change their unit definitions during the game.
you could hack some stuff e.g. by adding in all the different weapons and disabling/enabling them from the unit script. (I trust you're comfortable coding with lua?)

Zero-K has custom commanders, which are actually pre-defined unit definitions sent to the game via an integrated website. Its an imperfect solution, but it was easier than implementing the necessary changes to the engine.

Re: Units Cstomization

Posted: 30 Dec 2011, 09:42
by knorke

Re: Units Cstomization

Posted: 30 Dec 2011, 11:57
by Zguba
well thats interesting. Thank you for answers. Propably i must re-think mu idea.

And no - coding/scripting is not really problem here, just want to take some hints :)

Re: Units Customization

Posted: 30 Dec 2011, 15:44
by Google_Frog
There seem to be quite a few ways of implementing modular units but no method is particularly simple. I'd suggest you try out the various games and their methods then look at the code of one that is close to what you want.

The Zero-K custom commanders method has the player design a few units online. The commanders for each player in a particular game are sent to the host and those units are generated. This requires infrastructure which is probalby beyond what you want to do currently but it does demonstrate that creating hundreds of extra unitdefs at game start is feasible. A drawback of this method is the difficulty in changing unit appearance, to do so requires piece swapping in tthe script.

The simplest method that I know of can be done with fireplatforms but I am unsure whether it is a robust solution. I like the sound of FLOZi's method so maybe you should talk to him.

Re: Units Customization

Posted: 30 Dec 2011, 15:46
by FLOZi
My method is not so good for assembling a unit out of different chosen pieces, fireplatform is probably the easiest route to go with that - or the micromachines method (all combinations made already and switched between) depending on the number of pieces you can put together.

Re: Units Customization

Posted: 30 Dec 2011, 15:51
by smoth
Image
my old hack LIVES BWA HA HA

Re: Units Customization

Posted: 30 Dec 2011, 20:09
by bobthedinosaur
well there is a new *A game out there by deathknight that allows for customization of units.

Re: Units Customization

Posted: 30 Dec 2011, 21:08
by Deadnight Warrior
It's not that new, started roughly 2 months ago, but if you want to test it download YAAG (Yet Another Annihilation Game).