• 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
SineNomine

Hypothetical Problem

13 posts in this topic

Ok so I have this purely hypothetical problem and I would like some professional opinions on it.

Basically I, oh - of course I mean a friend of mine. Is part of group of independent developers who are working on a new game, it has been recently released and now they are wanting to make it multiplayer. This involves a great many changes, as majority of the program was not built with multiplayer in mind. The current medium is C++, with much in script files.

The current plan is to start the server section in C# on reasoning of "It's really simple actually, rapid development while not sacrificing any speed/power".

Now my friend thinks this is a terrible idea, simply because a lot of the code the server and client uses will be the same, or similar variations. Which means we will have some mixture of cross language interfaces, code rewriting and code duplication all of which should be avoided where not necessary.

I have no issue C# as a language, if we were starting again its perfectly valid choice, but the fact is we have a lot already done, a majority of which only needs adapting not completely rewritten.

So I come to gamedev to hopefully get some professional objective opinions.

Thanks,

P.s. I put this in "General programming", as it although pertains to a game, the problem is not specific to games. Feel free to move it.


Edit: I must make clear that I know it could work, i don't dispute its perfectly possible, - its more why do that why?
I think there is obvious hindrance and no actual benefit. Edited by SineNomine
0

Share this post


Link to post
Share on other sites

Not sure what you are asking about for "the server section".

 

If you are talking about a client/server architecture and the other executable being in a different language....

 

The client and the server are generally completely different code bases.  They may share some enumeration values and other constants, but the logic behind them is usually very different.

 

All that really matters is that the network protocol between the two is the same.  

 

A properly developed networked game will have a very clearly defined communications protocol.  If you are following best practices it should not be an issue.

 

 

 

 

If you are talking about each individual game being able to host a game, and that in-game code being written in a different language...

 

Mixing languages inside code is not a difficult thing.  Most major games incorporate compiled code from multiple languages.

 

It is very straightforward to mix C++ and C#, especially on the PC.  It is a little harder on consoles, but I've known many shipped titles that use Mono to ship with compiled C#.

Edited by frob
2

Share this post


Link to post
Share on other sites

I was more referring to how all the various different types of objects in the game are stored and connected to each other.  It is true that server, client and standalone will have different views of these objects, but they'll have great similarities.  For which i think using same code would be best.
Maybe I am exaggerating the complexity of mixing C++, C# but you surely can't say that it would be simpler without such?

- Most importantly, thank you for response.

Edited by SineNomine
0

Share this post


Link to post
Share on other sites

It is true that server, client and standalone will have different views of these objects, but they'll have great similarities.  For which i think using same code would be best

Whether or not you use the same language for each, you still have to convert every object to a language-agnostic format to actually send over the network (and if you use something like protocol buffers, you won't even have to write different serialisation code for each language).

 

Once you've digested that concept, the client and server should really never be performing the same operations on their data. I think you'll quickly find that the similarities are only surface deep - even if you build it all in one language, the server-side will need completely different classes to the client (even to represent the same objects).

0

Share this post


Link to post
Share on other sites
How objects are viewed when talking between the client and server depends on your serialization tools, not on the programming language.
1

Share this post


Link to post
Share on other sites

I hear and understand what you guys are saying, I know server and client have different views of an object.  But there will be similarities, if I was using the same language for both then the common variables and functions would be in a class that the specializations derive from.

 

I may  be over apprehensive over having little bits of code here and there written in different languages.  But it does seem very messy to me, especially if it can be easily avoided?

0

Share this post


Link to post
Share on other sites

I have found that if a game is not written to be a multiplayer game from the very beginning, it is an incredible pain in the ass to adapt it to be.

 

yes, your server/clients well share alot of code base, generally what i do is write a base game as a library, which has very defined methods of outside interactions(generally by feeding it an "Event"(rather that be a network object update event, or simply an user input event, it's easier to control how the engine behave's if you have a single point of entry to modifying your world from outside interactions(i.e input/network code)."

 

so basically, when i write the server code, i simply listen to incoming events from clients, verify the event as a legal event, mark the engine tick it was received, and distribute the event to the other clients.  note that this does not involve modifying how the world behaves, it's just another method of interface.

 

this system has worked very nicely when working with different pieces of the same game(such as building a level editor, server, or client(rather that be singleplayer or multiplayer)).

0

Share this post


Link to post
Share on other sites

Both - standalone server but client that can host, however I think the current plan is too have client simply start up a local standalone server and interface with that even in single player.  Which also strikes me as bad idea, we already have performance problems.

0

Share this post


Link to post
Share on other sites
That's a very ambitious undertaking, no matter how you slice it.

Retrofitting an existing SP game with this functionality will be an unmitigated nightmare.


How badly do you want to do this? Because you're going to have to pay for it dearly, in terms of time and implementation effort.
2

Share this post


Link to post
Share on other sites

Oh I know, I also know no matter how bad I can anticipate it will be, it will still be worse. sad.png

Some parts have been built with eventual multi-player in mind, basically strong boundaries between user interaction and the actual responses.  But still, i know nightmare ensues.
If it helps, assume we have an abundance of time.

What I am looking to do is reduce the nightmare as much I can. 

0

Share this post


Link to post
Share on other sites

What I am looking to do is reduce the nightmare as much I can.

In that case, my $0.2 is that implementing servers in C++ is a bigger nightmare than you imagine ;)
0

Share this post


Link to post
Share on other sites

Oh I know, I also know no matter how bad I can anticipate it will be, it will still be worse. sad.png

Some parts have been built with eventual multi-player in mind, basically strong boundaries between user interaction and the actual responses.  But still, i know nightmare ensues.
If it helps, assume we have an abundance of time.

What I am looking to do is reduce the nightmare as much I can.

Actually, this does point to a particular problem with switching languages for the back end: if you're going to be moving old code to server, then if would help if you don't have to translate it to a different language.
0

Share this post


Link to post
Share on other sites

C# makes a lot of things simple.

I doubt you'd have a significant portion of code that is going to be shared if you do client and server in C++, so I would say rewriting few classes in order to use C# will overall speed up development time.

 

I'd vote against C# on basis of how you cannot control when GC happens, and how it ties your server to windows, but that's not the question you're asking.

1

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