Starting spring from the command line without a setup - Page 2

Starting spring from the command line without a setup

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Re: Starting spring from the command line without a setup

Post by Auswaschbar »

Tobi wrote:BrainDamage pointed out that for this to work Spring probably would have to send the generated script.txt over the network.
Thanks for pointing this out, but that was my intention (code is ready btw, need more testing thought).
Tobi wrote:This would give opportunity to also do this for normal games, except for the few variables that must differ per player.
This will be enabled for every game (because every game will have a setupscript then).
Tobi wrote:The advantage is that then lobbies don't need to sync 100%, since what the host lobby thinks the settings are, will get used. Lobby clients that only joined battle wouldn't need to write more in script then HostIP, HostPort, and MyPlayerNum (or name, for more robustness wrt player/team/allyteam reordering?)
Player number with optional name (and a warning when its not set) sound reasonable. Player number have to be the one shown in the lobby, reordering will happen at the server's (engine) side.
User avatar
BrainDamage
Lobby Developer
Posts: 1164
Joined: 25 Sep 2006, 13:56

Re: Starting spring from the command line without a setup

Post by BrainDamage »

Auswaschbar wrote:
Tobi wrote:The advantage is that then lobbies don't need to sync 100%, since what the host lobby thinks the settings are, will get used. Lobby clients that only joined battle wouldn't need to write more in script then HostIP, HostPort, and MyPlayerNum (or name, for more robustness wrt player/team/allyteam reordering?)
Player number with optional name (and a warning when its not set) sound reasonable. Player number have to be the one shown in the lobby, reordering will happen at the server's (engine) side.
why can't the index be the playername? I could actually make fixed start positions be useful by reordering the players according to the team instead of the stupid behaviour ( 90 lines resorting code! ) SL has to do to keep compatibility with other clients
Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Re: Starting spring from the command line without a setup

Post by Auswaschbar »

Brain Damage wrote:
Auswaschbar wrote:
Tobi wrote:The advantage is that then lobbies don't need to sync 100%, since what the host lobby thinks the settings are, will get used. Lobby clients that only joined battle wouldn't need to write more in script then HostIP, HostPort, and MyPlayerNum (or name, for more robustness wrt player/team/allyteam reordering?)
Player number with optional name (and a warning when its not set) sound reasonable. Player number have to be the one shown in the lobby, reordering will happen at the server's (engine) side.
why can't the index be the playername? I could actually make fixed start positions be useful by reordering the players according to the team instead of the stupid behaviour ( 90 lines resorting code! ) SL has to do to keep compatibility with other clients
I somehow miss the point of your post, because playernames have an 1:1 relationship with their numbers.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Starting spring from the command line without a setup

Post by Tobi »

Ok nice, didn't know you already started on it :-)
I somehow miss the point of your post, because playernames have an 1:1 relationship with their numbers.
That's what we as engine devs think, Auswaschbar.

With all the weird reorderings happening in lobbies a player with same name can have different ID on one lobby then on other lobby.

Also spring can't do it's reordering if lobby would only write MyPlayerNum/HostIP/HostPort in the script. And then players could get different IDs because of different gap removal / bot sorting algorithms in different lobbies.

Player name is almost per definition more suitable for player identification then player ID, in (cross-)Spring context (not lobby server ofc).
Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Re: Starting spring from the command line without a setup

Post by Auswaschbar »

After BrainDamage told me about the weirdness of the player numbers, I agree that names are the better solution.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Starting spring from the command line without a setup

Post by AF »

Player ID in the lobby is related tot he order in whcih they joined the battle, thus you cant just store an array of playernames they ahve to be ordered correctly.

What's more the server doesn't facilitate this so you have to track joins and leaves in existing battles otherwise when you join a battle the existing players will all be ordered incorrectly. Its counter intuitive, its not mentioned in the documentation or server source code, and its extremely annoying to new develoeprs.

Moving script.txt purely on to the host would make things much much simpler and make development of new lobby code much easier. We could also remove a sizable chunk of code from the lobbies too.
Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Re: Starting spring from the command line without a setup

Post by Auswaschbar »

As you might have noticed, I made some progress here, but I encountered another problem:
When a default script is generated with one player, after the game finished loading it instantly starts. AThe server won't let other players join from the net, because A) it starts as soon as it finished loading and because B) the server won't know about other players at startup time.

How it was done before:
When stating without a setup, 31 non-existant fake-players were added.

Ideas how it could be handled in the future:
  • set the server in some sort of test-mode
  • some new setupscript-tags "AllowOtherPlayersJoin" and "NoAutoStart"
  • adding some fake-players to represent empty slots where everyone can join in
Thoughts?
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Starting spring from the command line without a setup

Post by lurker »

Posts wrote:re: player numbers -> player names

large random numbers? (block exploiters pretending to be someone else)
Would be pretty pointless at present as the server gives away unconnected numbers like candy to anyone joining without a valid number. Also is pretty pointless since it's not like it won't be noticed unless it was deliberate, and a deliberate switch could be done with large numbers anyway.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Starting spring from the command line without a setup

Post by hoijui »

i noticed that the AI test start scripts dont work anymore.
(i dont know if this relates to this topic, but i possibly yes).i ma pretty shure that it happened somewhere between 6941 and 6967.

what happens:
you choose mod, map, and AI.
the game loads...
when loaded, it shows:
Waiting for players:
Enemy

so the AI is not loaded.
i have a guess: when reading values from the temporary script, there seems to be no aidll tag set.
(at least i observed that on the caibranch, after reintegrating trunk up to 6967)
Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Re: Starting spring from the command line without a setup

Post by Auswaschbar »

The AI will be loaded when the game is starting (you need to force-start because if I would make it autostart, kloot no longer has scriptless multiplayer). The aidll= tag is indeed not set (the globalai-startscript should handle this).

edit: it actually does, tested with RAI
User avatar
Dima
Posts: 8
Joined: 07 Nov 2008, 23:33

Re: Starting spring from the command line without a setup

Post by Dima »

I suggest make command line interface too. I dont know about ingame interface, but new player may leave it and use SpringLobby. Divide main things: easy access and simple view of use.
Post Reply

Return to “Engine”