• 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

New guy introducing and looking for information about 2D multiplayer/network architecture

0 posts in this topic

Hi there fellow gamedevs and those who'd like to be, such as me.
The last 4 days or so I've been into playing around with 2D animation and, for the purpose of being able to develop games with multiplayer features, networking via sockets, and of course encountered many problems, of which some I have been able to resolve after some research.
But I might as well try to get some input here instead of trying to google everything for hours (which I will of course continue to do [img]http://public.gamedev.net//public/style_emoticons/default/biggrin.png[/img] )

Since this is my first post here, some information about myself might be a good start, so just skip the next "section" if you are just interested in my current problems [img]http://public.gamedev.net//public/style_emoticons/default/biggrin.png[/img]

I'm currently 23 years old and studying for a bachelor degree in informatics (also I'm from germany btw).
Some of it is interesting, some is not, but we don't really get into things which would be crucial for game developing (or rather, I can't see those aspects yet).
In my free time I like to play electric/acoustic guitar, do some sport (I guess most of you havn't heard of tricking) and playing games myself of course. Over the years, I often tried to find a way into developing games, but have never been persistent enough to get anywhere (last thing I did was a well working snake game in python...yea, the irony.), though my accomplishments over the past few days made me think I can do it now if I keep trying. Or at least learn a bunch of things which might me help one day.
That's actually the main purpose of it all, learning, getting "into it" y'know [img]http://public.gamedev.net//public/style_emoticons/default/biggrin.png[/img]
So I don't actually have a finished concept for a game I'd like to develop, but rather I'm gathering things I might want to implement, and try learning how to do it so that I first know which technical features are possible for me to implement.
After that I'd want to think about which what kind of game could make good use of those features.
Though I already have some ideas which won't let me sleep at night, dammit.

So heres what I achieved and what I couldn't achieve so far the past few days.
I'm currently using Ruby and the rubygame gem, which works good so far.

First step was, just creating a screen and having an animated sprite, moveable by the player.
Wasn't too hard, works well, movement and animation is fluent and appropiate at any given time.I didn't use the Sprite class though, for me it was easier to work without it as first (will need it for collision though, I guess).

Next step already went into networking, My goal for that matter was to be able to connect 2 clients to the server, both being able to move and also see the movement of the other player. I'm still far from there, but made some progress:

1. got familiar with TCP/UDP Sockets and decided to use UDP sockets because they are faster and the game view should update constantly anyway, so a bit of missing data here and their would be affordable.

2. Communication between the server and multiple clients works, one client sends a string to the server and all clients receive it. also keeping track on how many/which clients are connected, so everything works as long as i dont exit a client by closing the output window. (instead use ESC or the QuitEvent of the gamescreen)

3. got information about serializing, so I could send whole objects via sockets. Also working.

4. got information about threads, so I could let every client have 1 thread handling the input from the server.
Doesn't work quite well, I don't know if its me or Ruby's threads, but the threads get to work a bit every few seconds, which would be equal to massive lag in a multiplayer situation. Possibly trying to use Java threads via JRuby (have read about it somewhere)

So now the problems I couldn't resolve so far:
1. I'm confused, like, what the hell? [img]http://public.gamedev.net//public/style_emoticons/default/biggrin.png[/img] I don't even know where to start. Actually, that covers the first problem.

2. What should a network architecture for these kind of tasks look like? Like, should I create a class for the server, the client, then in a different file creat server/client objects?
How can I build the code so, that the server handles all the logic, while the client only gets the user inputs and updates the view? (to prevent cheating). Currently, the calculations for the new positions for x/y values and animation cycles are still done within the client's code, according to the current framerate and the general speed of movement of the player(which is determinde by some vairable). I'm kinda confused as to what impact on performance and updating it would have to get all the logic to the server, sending the new positions back, and what the best way is to achieve that code-wise.

3. Serializing, how to efficiently utilize it?
Obviously I need to send serialized objects to the server, which recognizes the objects and can work with the data, then sends the serialized object back so the client can update the screen according to the data. Sounds simple, but I'm struggling with how to actually implement all that stuff, I have the feeling I'm just over-thinking many things and miss the obvious solution.

4. The threads, I already mentioned that before. They are slow. Like, really. Whats the point of a thread which only gets some time to work every few seconds, here and there. I guess there are applications which can make use of that, but a 2D Multiplayer? I highly doubt it [img]http://public.gamedev.net//public/style_emoticons/default/biggrin.png[/img]

One thing I'd also like to say, some of you will most likely remember having googled all these topics on how to start making games, all those guys in forums asking that question and being told they need to know the basics, make a small little simple game before doing anything bigger.
So just saying in advance, please don't give me that, I've been there [img]http://public.gamedev.net//public/style_emoticons/default/biggrin.png[/img]
But I guess you're all smart enough to see that I'm already trying to dig up the basics and yea...wow, that was much, much more text than I expected, guess I got carried away a little.

Anyways, anything to help me out with any of the topics I have posted here is appreciated, be it references to tutorials/guides, sharing your own experiences or just some thoughts you made up on the spot. Edited by Gazu

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