Page 1 of 1

More flexible Startpoint allocation/choosing (in lobby)

Posted: 22 Sep 2007, 10:26
by hoijui
[Help/Future Request] AI-player compatible Team-Startpoint allocation/choosing (in lobby)

I usually play Spring with one or two friends over LAN. We like to play in together in one team against some AI players. So far, we have not found a way to place ourselfs and the AI players as we would like.
We usually want to be on one side of the map, while all the AI players would start at the opposite end of it.
- When choosing 'Fixed' start positions, it doesnt work, casue all the human players get placed first, which makes the second to appear at the opposite side of the map as the first one.
- When choosing 'Random' start positions, we have to restart the game several times, till we start as we want.
- When choosing 'Choose in-game' start positions, we choose our positions, and when the game starts, the AI players either start all at the same spot or the whole game crashes.

I see two possible solutions:
- have a 4th setting 'manual start positions', where the players can choose their own and the start position of the AI player they host
- somehow get the AI to choose start positions when using the setting 'Choose in-game'

i guess the second option is nicer, but i dont know how hard it is to realise either.
..or is there a solution already?

Posted: 22 Sep 2007, 12:09
by koshi
you can already set the ai start position manually. ingame, before clicking ready enter in chat:

Code: Select all

.cheat
.team x (where x=teamnumber of ai, remember count starts at 0)
-click for start position
.team y (your own number)
.cheat
nonetheless i agree a little less hackish solution would be nice
- somehow get the AI to choose start positions when using the setting 'Choose in-game'
iirc that's not possible since the ai is not loaded until after the game starts

Posted: 22 Sep 2007, 12:35
by hoijui
(deleted)

Posted: 22 Sep 2007, 12:47
by hoijui
thank you! :-)

i will do it that way from now on!

..what you said about the AI...
maybe a simple algorithm could be added to either:
- assign the AI players to different startpoints (taken from the list of startpoints in fixed mode), which are inside the rectangle for their group/'ally'
- select (random) points with some minimal distance between each other to use as startpositions

this would be a bit less hackish and the human players would not exactly know where the AIs are placed (at least not from the start of the game).

i am not really a C++ coder (have sufficient practice in Java), but if it is possible and you could tell me about where in the code i had to start looking at, i would be glad to try it.

Posted: 22 Sep 2007, 13:30
by koshi
hoijui wrote: maybe a simple algorithm could be added to either:
- assign the AI players to different startpoints (taken from the list of startpoints in fixed mode), which are inside the rectangle for their group/'ally'
- select (random) points with some minimal distance between each other to use as startpositions
both good ideas
hoijui wrote: i am not really a C++ coder (have sufficient practice in Java), but if it is possible and you could tell me about where in the code i had to start looking at, i would be glad to try it.
without any knowledge of the inner workings of the engine i suggest you take a look at GameSetup.cpp around line 154. i guess it would be necessary to test for ai player and call a custom CStartPosSelector (UI/StartPosSelector.cpp). but you should really ask a dev about that. maybe post a feature request.
also take a look at the springlobby thread, where a manual ai placement feature has already been requested.

Posted: 22 Sep 2007, 13:51
by BrainDamage
koshi wrote: also take a look at the springlobby thread, where a manual ai placement feature has already been requested.
the manual placement has been added 2 months ago ;)

now the limitation is the engine, not the lobby/launcher, you'll have to wait for the next release in order to be able to use it, the suggestion yokozar did was about extending the GUI for it, not the support