• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

tips on making a simple web-based game?

eLiu

Diamond Member
I'm trying to make a super simple web-based game (tic tac toe for example) but I'm not even sure where to start. Like I can write C code + cmdline interface easily enough. But how to set that up w/a gui online is a mystery...

One option would be to like do everything in java & embed an applet. But what are my options for having some C code as the backend? Like I could autogen a new html page every time the board updates but that seems awkward. Would that have to run on the server?

thanks in advance,
-eliu
 
The simplest method would be HTML and some Javascript. No need for server side code.

How hard is it to set up C++ as the backend? I do lots of scientific computing so I know things like C, fortran, etc like the back of my hand. But I know almost nothing about html, javascript, and whatever else.

So I can try to learn some javascript and give that a whirl. But I'm also curious about what it would take to use C directly?
 
Its possible, but you would be wasting a lot of good work done on precisely the problem you are trying to solve. You would be reinventing the wheel rather than simple learn a new language/paradigm.

Play around with Javascript, have fun. The worst that could happen is that you learn something new and add another skill to your toolset. Change your mindset to use the best tool, not just the tools you know. Programming languages are just tools after all.
 
Tic-tac-toe can be done with pure HTML. Multiplayer would need a back end, but C or Java would be silly, when PHP will be on most web server, ready to use.

Instead of setting up a backend with clumsy low-level tools like C, learn how HTML and HTTP work, and use clumsy high-level tools like Python, PHP, and/or Javascript 🙂.
 
If you really want to write with C or C++, you can. One of the oldest methods for setting up interactive websites, CGI, can do that. I see they mention a helpful library.

But really nobody uses (well, writes their own) C or C++ for websites because they're insecure. It's easy to attack them with buffer overflows and such.
 
Ok, cool. Thanks guys for all the reasons not to even bother trying w/C++ 🙂

I wasn't against learning something new... more like I wanted to learn multiple ways to do it. But if the C/C++ backend route is by far the shittiest, then by all means I will avoid it.
 
You could also use asp.net - using C# as backend is easy and not uncommon. Or if you don't want C#, there's managed C++ (or c++/cli). I haven't seen native C++ or C with asp.net, but perhaps it can be used. If not directly, maybe with P/Invoke.
Of course, this will limit the server OS to Windows.
 
Back
Top