gaia instances

gaia instances

Requests for features in the spring code.

Moderator: Moderators

Post Reply
res
Posts: 15
Joined: 19 Aug 2017, 21:27

gaia instances

Post by res » 12 Nov 2018, 12:17

Hi

I would like to be able to use different "instance" of gaia team ids. For instance gadget A uses random walking trees
but want not to upset the random flying flowers of gadget B.

A work around is to test if gaia units belong to some table specified in gadget A to only apply stuff on gadget A.
This however I expect becomes fast cumbersome and seems not very efficient.
1 x

gajop
Moderator
Posts: 3022
Joined: 05 Aug 2009, 20:42

Re: gaia instances

Post by gajop » 12 Nov 2018, 12:30

Tracking units/features of different type is fairly easy to do. Having different Gaia teams doesn't seem like a good idea.
What are you having issues with?
1 x

res
Posts: 15
Joined: 19 Aug 2017, 21:27

Re: gaia instances

Post by res » 12 Nov 2018, 12:58

Hi,

Thanks for the fast reply. I was also curious about the implications of such an implementation.
Having different Gaia teams doesn't seem like a good idea
could you elaborate?
Tracking units/features of different type is fairly easy to d
are you aiming of using tables?

I tend to overuse gaia units (compare to the normal usage) a bit by making them interact (hunt, kill, feed on stuff).
This requires the use of a lot of callons. I just remembered that I did use a table to track all units used so maybe this
is all too much overkill. In this line of thinking i thought i be better of making a gadget that manages my subgroups of gaia
for many reasons. Actually the only real problem i see is maybe unit limit but that is probably easily modded.

So maybe yes this is overkill if i think i still need it i will try again.
1 x

gajop
Moderator
Posts: 3022
Joined: 05 Aug 2009, 20:42

Re: gaia instances

Post by gajop » 12 Nov 2018, 14:03

res wrote:
12 Nov 2018, 12:58
Having different Gaia teams doesn't seem like a good idea
could you elaborate?
Teams are used to model different unit owners. It doesn't make sense to add teams to model different unit types.
are you aiming of using tables?
Nothing wrong with using a table to track existing units of a specific type.
When I want to model a behavior for a certain type of units I tend to write some boilerplate code like this: https://github.com/SpringCabal/LD42/blo ... skimos.lua

1. There's a predicate which models the type of units I'm interested (often based on some defID), in this case UnitCanDrown
2. Each time a unit is created I store it in the table (ID based mapping) in case it satisfies the predicate
3. I remove units on UnitDestroyed
4. I populate the initial table on Initialize
5. I model the rest of behavior elsewhere, in this case in GameFrame

If I want to different behavior of a different unit type, I would have a different gadget. There's no limit to the amount of gadgets like this I can have.
Sometimes behavior can also be modeled in unit scripts but I prefer to have those files represent animations alone.
1 x

res
Posts: 15
Joined: 19 Aug 2017, 21:27

Re: gaia instances

Post by res » 12 Nov 2018, 15:37

Yeah the table approach i also found to work fine.
I rest my case for now cause you convinced me.
I am not totally familiar with automatic targeting.
That might be a real benefit of having more teams.
1 x

gajop
Moderator
Posts: 3022
Joined: 05 Aug 2009, 20:42

Re: gaia instances

Post by gajop » 12 Nov 2018, 22:45

res wrote:
12 Nov 2018, 15:37
I am not totally familiar with automatic targeting.
That might be a real benefit of having more teams.
Sure, if you want things to fight each other, and there will be a certain limit to how many of them there are, then teams definitely make sense.

PS: It might be best to come with concrete problems and code snippets. It is easier to help you out in that case.
1 x

sprunk
Posts: 83
Joined: 29 Jun 2015, 07:36

Re: gaia instances

Post by sprunk » 14 Nov 2018, 19:57

I think multiple Gaias (in general, extra allyteams not specified in startscript) would be useful.

Example: in ZK we have chickens and zombies who are two types of environmental hazards hostile to all players that would each, separately, make sense to be Gaia. But we still want them to fight each other so they can't both be Gaia. What ZK does is that the lobby server looks at modoptions and inserts a new team for the chickens into the startscript and chickens-related logic (including game-over gadget) knows to treat that team differently (and zombies are Gaia).

This approach works out okay for ZK but there are many problems:
* duplication, usually multiplayer and singleplayer startscript is generated in different places and both need to implement this logic.
* maps. They might want to add something on their own. This is the original use for Gaia but a game might've used Gaia already and the two gadgets would likely confuse each other. Even if all games used the "inject teams" approach to make Gaia free for use by the map it would still not be enough because a map might want to have things hostile to each other. For example WC3 had two "Gaia" teams: "neutral" for misc stuff like wandering sheep, goldmines and shops that was neutral towards everybody else and "aggressive" which was stuff like wolves or dragons which were hostile to players and sometimes towards the neutrals too (on most stock maps they were neutral towards neutrals but custom maps could change their diplomacy).
* control. As a game dev you cannot do anything about an autohost owner using stock settings and not implementing the injection. For singleplayer it's even worse because you'd need to get your logic inside stuff like SpringLobby for singleplayer skirmish to work.
2 x

Post Reply

Return to “Feature Requests”