• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0

Structuring the server-client interaction in a tick based multiplayer online game

1 post in this topic

Hi All,


I am an experienced programmer, but my background is in scientific computing (number crunching..) using old school languages (mainly C/C++ but also FORTRAN). I am looking to get into web game dev as a side project and have been learning some more modern web capable languages including java-script/HTML5/CSS and python for server side scripting, but I'm still a novice and don't have 'the big picture' of web programming fully formed in my mind yet.


I've written a bare bones prototype of a web based sports manager game which uses HTML5/JS for the client side (training players, selecting sqauds, setting tactics etc) and python for the server side computations of the game result. I am after 2 things, the first is a sanity check that the basic structure I'm planning and have partially implemented is sane and the second is where to host this in order to alpha/beta test the game once it's closer to completion.


Here is the basic structure of the game at present:


* Client side in HTML5/JS running in a web browser on desktop or mobile device sends info to server about team management. All this info is to be stored on the server in a MySQL DB. I'm shaky on implementing JS for clients to modify DB contents, any hints here?


* At regular intervals (probably once a day) games are resolved on the server using the python code reading the setup for each team from the DB. This outputs to the MySQL DB the game results as a time series of co-ordinates, angles and states (i.e. standing, running, knocked down...) for each player and the ball. This part is implemented (although only a bare bones version at the moment).


* Clients use the web interface to view match replays which are rendered in JS (using jQuery.spritely at present) from the co-ordinates obtained from the server. I've partially implemented the JS animation (very ugly at the moment), though only from a fixed co-ordinate set, not talking to the server yet. I assume I'd use AJAX/JSON (or XML??) to obtain this info from the MySQL web DB to do this but again I'm shaky on how this should be implemented.


That's the basic outline of the game. Does that seem to make sense? Is there a better way to acheive what I'm trying to do?


The next part is where to host this. My home ISP has some free web space that I've used before for simple HTML and I had planned to set this up for alpha testing on that, however it turns out they have very bare bones set of tools, with only perl, PHP and MySQL supported (not python). So, what are some good options for a free or very cheap (<$10 a month) hosting of this game that would allow me to test the full setup with a small number of players? Ultimately of course I'd dream of growing this into a game with a decent player base that may in the fullness of time outgrow a free/cheap option and require a decent web server. Therefore a hosting option that allowed a relatively seamless transition to a meatier option would be good. I've scratched the surface of Amazon Web Server info which seems a reasonable option. How does this compare to other possibilites?


Thanks in advance for any help or advice.

Edited by Bogdanovist

Share this post

Link to post
Share on other sites
That sounds like a pretty normal approach, except the "write the database using Javascript" part.
You never, ever, want to give the client the ability to read/write the database, because databases are not as secure against internet misbehavior as application/web servers are.
Plus, you don't want the players to write the database and say "my quarterback is now 1,000 pounds and can do the 100-yard dash in half a second" ;-)

Thus, I highly recommend that you define a few simple GET and POST web services, REST style. One kind of GET for getting the current state of your team, people, game, etc. One kind of POST for setting "these are my current orders." Note -- not "this is the outcome of what the client did," but "these are the orders."
Then, when resolving the game, the server takes the recorded orders, and applies them to the game, and updates the state of the game.
You might want some kind of GET request to return information needed to create a "replay" too, separate from the GET that returns the state of the team for a particular player.
Additionally, you need some simple login/password mechanism, and you're pretty much done with the back-end from a gameplay perspective -- all the "snazzy" stuff can be done in HTML/CSS/JS.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 0