Creating My Own Game - Unanswered Questions

Creating My Own Game - Unanswered Questions

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

Moderator: Moderators

hlecko
Posts: 3
Joined: 06 Feb 2012, 14:43

Creating My Own Game - Unanswered Questions

Post by hlecko »

I am trying to create my own custom game that also utilizes a custom made server (like the TASServer) and client (like SpringLobby). These are some questions that I have come up with after reading through the protocols for the SpringLobby and threads on the Spring forums.


Where is game data written and maintained in real time while the game is running?

How is the network architecture set up between two SpringLobbys on a LAN?

How is game data passed over the network? Is it using the same methods as the chat room channels?

What is the organization of the true network architecture?

Is the network protocol for the running game data embedded in the Spring engine, unable to be isolated?

Is there a way to set up a custom method for handling the game's transfer of information over a network?
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Creating My Own Game - Unanswered Questions

Post by knorke »

Hi
I am trying to create my own custom game that also utilizes a custom made server
If I understand correct, you do not want to use the spring engine..? You just want to get some inspiration how to do things for your own project? Because if you want to make a spring game most questions are unrelevant.
Where is game data written and maintained in real time while the game is running?
uhm, in memory? And some cache files like cache\paths for pathfinding.
How is the network architecture set up between two SpringLobbys on a LAN?
one player runs a lobby server and everybody connects to it with SL.
http://springrts.com/wiki/Spring_on_a_LAN
How is game data passed over the network?
by magic, unless you want to get really technical?
Is it using the same methods as the chat room channels?
lobby chat uses some rather simple textbased protocol:
http://springrts.com/wiki/Lobby_Development#Protocol
What is the organization of the true network architecture?
simulation runs on all player's computers, only commands are send over the network.
Is the network protocol for the running game data embedded in the Spring engine, unable to be isolated?
dont know what you mean. You want to reuse spring's network part?
Is there a way to set up a custom method for handling the game's transfer of information over a network?
If this gets finished, then yes.Or maybe you want this:
http://springrts.com/wiki/Lua_UnsyncedCtrl#SendMessage
SirMaverick
Posts: 834
Joined: 19 May 2009, 21:10

Re: Creating My Own Game - Unanswered Questions

Post by SirMaverick »

knorke wrote:
What is the organization of the true network architecture?
simulation runs on all player's computers, only commands are send over the network.
Spring's engine is a server-client architecture. All commands are sent to the server and then broadcasted to all clients.
User avatar
Cheesecan
Posts: 1571
Joined: 07 Feb 2005, 21:30

Re: Creating My Own Game - Unanswered Questions

Post by Cheesecan »

I have a funny feeling this guy wants to make a MMO. :roll:

If you want a cool custom lobby, then by the time your game is done, OpenLobby will probably be done too. It's still just a regular client-server lobby though, nothing magical.
hlecko
Posts: 3
Joined: 06 Feb 2012, 14:43

Re: Creating My Own Game - Unanswered Questions

Post by hlecko »

What I really want to know is, when the game is playing HOW are the actions of one player made known to the others?
Where is that information detailed in the protocol? I have looked at the protocol, and all it covers is the pre-game battle rooms. It says nothing about data handling while the game is running, such as units, player input, etc.
So far I have not found any protocols that describe the commands that handle in-game resolutions.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Creating My Own Game - Unanswered Questions

Post by smoth »

tasserver is the lobby server, where the games are listed not how the games are hosted by players.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: Creating My Own Game - Unanswered Questions

Post by Kloot »

What I really want to know is, when the game is playing HOW are the actions of one player made known to the others
You should always say _why you care first_, so people (if they feel like it; you are here to ask questions, but we are not principally here to answer them) can help you more effectively. Note that the answer which has been given twice in this thread so far is a general one, because that is all it can be (since you gave us no further information to go on) and therefore probably not useful to you.

Moreover:

If you are making a game for Spring, those details are not important.

If you aren't making a game for Spring (which "that also utilizes a custom made server and client" hints at), what's the point in asking _us_ when you presumably already know better than we do how to implement your game's specific networking requirements?
So far I have not found any protocols that describe the commands that handle in-game resolutions.
Because they only exist (loosely, as the collective design and workings of the netcode) in the engine's source, and don't need to be available to game developers.
Last edited by Kloot on 07 Feb 2012, 13:57, edited 7 times in total.
hlecko
Posts: 3
Joined: 06 Feb 2012, 14:43

Re: Creating My Own Game - Unanswered Questions

Post by hlecko »

Because they only exist (loosely) in the engine's source, and don't need to be available to game developers.
I was under the impression that this was an open-source project. My apologies, but this is quite necessary for my class project.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: Creating My Own Game - Unanswered Questions

Post by Kloot »

Sorry, while open-source (which Spring is) means many things, it does not require that every conceivable detail about some part of a project's codebase be made available as neatly documented protocols for any random passerby to base answers for homework / class projects on.

So again: begin with the _why_, then maybe we'll get to the _how_.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Creating My Own Game - Unanswered Questions

Post by smoth »

Wow
User avatar
Cheesecan
Posts: 1571
Joined: 07 Feb 2005, 21:30

Re: Creating My Own Game - Unanswered Questions

Post by Cheesecan »

hlecko wrote:What I really want to know is, when the game is playing HOW are the actions of one player made known to the others?
Where is that information detailed in the protocol? I have looked at the protocol, and all it covers is the pre-game battle rooms. It says nothing about data handling while the game is running, such as units, player input, etc.
So far I have not found any protocols that describe the commands that handle in-game resolutions.
Try lua, you can find out about what is happening in-game through lua. If this is a class project only, you might want to limit the scope of your work because whatever you intended will probably be way more work than anything your teacher suggested for you.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Creating My Own Game - Unanswered Questions

Post by smoth »

And if it is a team project assume half the team will be loafing around
saberRattler
Posts: 9
Joined: 27 Oct 2011, 04:27

Re: Creating My Own Game - Unanswered Questions

Post by saberRattler »

Hey guys, I am the group lead for hlecko's project. Hlecko is out IT major and working on the networking side, the 3 others are working on units/graphics/gui/gamedefs...

This is a senior CS/IT capstone project (our final project), and maybe I can help explain some of the problems. We are trying to design a RTS meeting specific customer requirements, and found the Spring engine to be the best option for development.

One of the requirements is to create a simple client and a server. This has been requested by our customer (a teacher who will be using this for instruction in future classes) and the capstone board. It does not have to be very pretty, it simply needs to connect players over a LAN.

Our first steps towards solving this problem were to go to the Lobby Development page and look at the protocol and source code contained there. However, the concepts and details are beyond our current scope of understanding.

Our main concern in development right now is to develop a simple client-server architecture without just leaching the code. From there we know there is a protocol that Spring follows, and some things cannot be changed if you expect it to still work.

We have spent a lot of time looking through forum threads, and you have been an immense help so far. The reason we are posting is that we feel the answers to our network development problems have not been previously addressed.

We will look more in-depth at the current examples in order to provide more insightful questions related to our problem.

Thank you for all the help so far!
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: Creating My Own Game - Unanswered Questions

Post by gajop »

Hmm, I'm not sure if using spring for a CS course example project is the right way to go.
But from what little I can hope to explain to you, you should understand that there are two connections:
1) Lobby server connection. This is really just a glorifiec IRC-like server that allows people to chat, host and join "battlerooms", and from there start games.

2) Spring game connection. This is a connection to a custom host (one that hosted that battleroom), and is used to play a specific Spring game (f.e Balanced Anihilation, Zero-k, etc.). This is where the game logic (simulation) happens, and I assume this is what you want to do.

In case of 2), you would need to look at the spring source probably, in order to implement a similar architecture. It won't be easy.

And last, and possibly most important part is: Most people creating spring games are really not dealing with the engine much, they are "just" creating unit models/textures/animations and unit mechanics. Sometimes they create other global game rules, but it all tends to be done in lua, never really working with the low-level spring engine networking. That alone is a long and demanding progress, and would be impossible if they were to work on the engine networking as well (for some odd reason), which is what you seem to be aiming at.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Creating My Own Game - Unanswered Questions

Post by smoth »

gajop wrote:And last, and possibly most important part is: Most people creating spring games are really not dealing with the engine much, they are "just" creating unit models/textures/animations and unit mechanics. Sometimes they create other global game rules, but it all tends to be done in lua, never really working with the low-level spring engine networking. That alone is a long and demanding progress, and would be impossible if they were to work on the engine networking as well (for some odd reason), which is what you seem to be aiming at.
addendum:
Very important to know that unit development only is a route if you want an *A project. Otherwise you may spend weeks integrating different lua from differnt games. Several games use their own internal lua to control things from economy(gundam) to aircraft(s44). Other games have complex tournaments with involved upgrade schemes based on persistent player data(ZK).

I don't know if that is helpful but your gameplay members of your team should DEFINITELY get with some of the more prominent content devs and discuss feasibility with regards to time required.
User avatar
Cheesecan
Posts: 1571
Joined: 07 Feb 2005, 21:30

Re: Creating My Own Game - Unanswered Questions

Post by Cheesecan »

Well I'm an asshole, you won't like me for posting this so be warned you might have to reconsider your project after reading this.

This is a prime example of a group of students trying to make the coursework fit their hobby or interests.

You've already seen that Spring has client-server developed so why are you trying to pawn this off to your teacher as a viable project(!!!). Having failed to grasp whatever it was you were grasping at you are asking us to come up with your research question. Wrong, wrong, wrong.

I don't know what kind of program you are studying but the only imagineable possibility I could see where this would be allowed is some type of game designer program where coursework is making games. Aside from that I couldn't possibly see how making spring units is something a teacher at a university would allow :| If so then I am seriously worried since that amounts to craftsmanship not engineering or science.

If understanding the networking source code is out of your current reach then you need to rephrase your idea into something you can do and inform your teacher so they understand what it is you're doing. If your teacher thinks you are going to develop a client-server game from scratch, I can tell you right now that isn't going to be happening unless your one lonely coder is john carmack^infinity.
User avatar
Licho
Zero-K Developer
Posts: 3803
Joined: 19 May 2006, 19:13

Re: Creating My Own Game - Unanswered Questions

Post by Licho »

Spring uses UDP protocol ... by default on 8452 .. it sends network messages, corrects order, resends them as needed. On the network level each client only talks with host.

Messages are then processed on each client in same order to ensure that simulation is identical on all of them.

System can also slow down the game flow if clients dont have CPU power to simulate enough frames.

Network message content can differ, most often its unit commands - like move order for unit X to coords Y - this is sent from client to host and host resends it to all clients. Sender only performs the action when he gets the command back from server with order number.

Some commands are produced by the lua scripts which are part of the game/mod definition and payload can differ. It can be messages that are not synced (not part of simulation) - like coordinates of allied cursors or even messages destined for autohost which then communicates with some external things like website (planetwars for example).
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Creating My Own Game - Unanswered Questions

Post by hoijui »

Licho is talking about point 2) from gajop's post.
the closest thing that 2) has to a protocol definition are these files:
https://github.com/spring/spring/blob/d ... Protocol.h
https://github.com/spring/spring/blob/d ... otocol.cpp
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: Creating My Own Game - Unanswered Questions

Post by Google_Frog »

What exactly is the aim of this project? As far as I can tell your task is either:
  • Create an RTS from scratch.
  • Create an RTS using any tool you like.
If you have to create it completely from scratch this forum is probably not particularly useful. People here will generally give you information about using Spring and a bit of information about implementation. I doubt you can get advice about implementing low level Spring things yourself as this isn't a general purpose programming forum.

If you have to create an RTS by whatever means necessary Spring is a good choice. You can still do plenty of coding down this path but it may not be what your course requires. Most of the coding is in lua but if you were really enthusiastic you could contribute to spring.

I suppose the core question is in the semantics of this:
One of the requirements is to create a simple client and a server.
Is the requirement that your RTS must have network capability or is it that you must apply whatever you've learnt in your course to implement network capability.
saberRattler
Posts: 9
Joined: 27 Oct 2011, 04:27

Re: Creating My Own Game - Unanswered Questions

Post by saberRattler »

gajop, Licho, and hoijui: Thank you all so much. I sat down with hlecko and looked over the code. There were some simple misinterpretations, and pointing out the source helped immensely. We looked through the source code for Spring and SpringLobby, and made connections much clearer between the two. We will push forward with looking at connections tonight.

smoth: much needed advice. Thank you. We will sit down and write up what we think we need to do for the global game rules. We realize that this is a big undertaking. As of right now we have only made a gui from lua and OpenGL, a handful of units to get the formatting down, and played with some premade game rules. Hopefully people will still want to work with us after this post :mrgreen:
Cheesecan wrote:Well I'm an asshole
We understand that, but we love you anyways.
The request for an RTS came from a teacher in our department, it was not our request. We thought that filling this gap would be more fun that what many do which is a html front with a database back.

Cheesecan (again) and Google_Frog
The aim was to create an RTS using any engine we would like.
The ultimate goal with the project is to have something that is highly modifiable. This is one of the greatest advantages we saw with Spring. Our customer (the teacher we are designing this for) would like us to create him something that he can use to teach in other classes. Some examples that he would like to be able to develop are:
1. Graphics (using Blender and L3DT)
2. Scripting languages (most of our coursework at school is either C++ or Java right now)
3. AI (formation based movement, rewriting pathing, whole team AI)
4. Game Making (learning how rules affect game play, balance)
5. Networking (will explain)

As far as creating a client server connection, the teacher would like us to make a setup where he can run a server and give his students in his class the client side code with pieces missing. Ultimately they will be guided through the process of creating a client that can connect to the server.

I sat down with hlecko and found the problem to be conceptual, we had him just focusing on networking. He looked at SpringLobby, but didn't look at Spring itself to realize that the lobby is running a message system for the instance of Spring running on the client's computer.
Post Reply

Return to “Engine”