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

WEBGL Game; things started in C++

10 posts in this topic

I posted two questions almost exactly two years ago, and have since done a bit of work on game logic and database interaction with C++ and mysql. I have python in there as well and I repeat some of the functionality with it, but for what I am doing, C++ seems ok and magnitudes faster than messing with data in PHP. Additionally and since two years has passed, I'm happy that I have chosen languages (C++, Python) that are stable and not here today, gone/forked/changed tomorrow.

 

I'm no expert in C++ or Python yet, but things are coming along and I want to start spitting out something visual. I'm seeing WEBGL as something viable, but I'm not sure how C++ fits, aside from a long chain of interpreters/compilers/converters - which sounds terribly messy and vulnerable to obsolescence as my development slowly chunks along year after year.

 

Language really doesn't matter at this point, as I'm not invested very heavily into anything library specific; I just don't to go back to PHP. I can do Python, would prefer C++ and understand JS is required, but I will compromise if the chain to WEBGL/JS is short.

 

I work on a remote VPS Debian/Ubuntu build, if that is any help in commenting. So I'm either going to start serving up web pages (the plan) or I need to start working on a client (huge downer, with added complication network-wise).

 

Any advice on moving forward?

 

Thank you!

Edited by trowtlip
0

Share this post


Link to post
Share on other sites

I'm a little confused. You mention doing programming with C++ and want to create something visual; do you mean 2D or 3D game?

You can use WebGL for that, but you'll have to create everything using Javascript, C++ has no place there.

However if you wish to use C++ with graphics then you need to look into OpenGL or DirectX. There's also SFML and other options but internally they use OpenGL or DirectX.

0

Share this post


Link to post
Share on other sites

3D.

 

I have read of some options, which kind of get's me to this post. I learned about asm.js which will take C++ and make a sort of complied JS that works for WEBGL. Though further reading, adds further middle steps to truly make it work.

 

OpenGL, SFML.. Are these becoming web technologies so-to-speak? 

 

Sounds like I'll still be stuck with client/server solution instead of a web interface. And realistically, I could spend many months moving onto network/multiplayer stuff, so I guess I still don't need anything visual. Would be nice though - maybe flesh out some of the creative concpts.

 

Thanks for your reply!

Edited by trowtlip
0

Share this post


Link to post
Share on other sites

I'd like the browser to be my entry point. I'd like something other than JS or PHP be handle backend work, and with my VPS configured how I choose, it seems I could come up with something better than just JS. Couldn't I have C++ handle the database and backend work, with the interface in WEBGL?

 

Right now, I just want to place some objects in 3D space that I can assign data to, interact with and provide feedback through the WEBGL interface. I don't really want to deal with a client per say right now. It's a matter of convenience I suppose; I can write code through SSH as opposed to setting up a dev environment on every computer I may be at, so I can develop client. I'm figuring WEBGL in a webpage allows essentially an instant client wherever.

 

Any suggestions with all of that? Is my post in the right category?

 

Thanks for the reply btw!

0

Share this post


Link to post
Share on other sites

You can have a 100% c++ solution using Emscripten (C++ -> Javascript compiler (including loads of open-source tech like SDL, GL, libpng etc...))

 

For the backend you can use Wt (http://www.webtoolkit.eu/wt) which allows you to code logic (in a similar way to PHP) but also provide an entire web server (or can be used as a cgi plugin for Apache).

 

I use both these technologies for my own projects and they work great. The only annoying bit is that even though you can code in C++, you are still constrained to what can be done in a web browser such as your client can only connect to a web socket server and you cannot write to the local filesystem using things like std::ofstream.

0

Share this post


Link to post
Share on other sites

Thank you!

 

WT looks pretty interesting in itself. I've installed it and I think I'm going to read about that. WT is probably a good foundation for what I'd like to do, so I need to get connected to SQL and get some query output from what I have going. I suppose I need some node.js or IO library of some sort, to help with the WEBGL end of it. 

 

If you have any tidbits on what you've done/experienced though WT, please let me know if you can; I'd certainly appreciate bridges over any upcoming pitfalls.

0

Share this post


Link to post
Share on other sites

Well, to communicate the frontend C++/Emscripten/HTML5 to the backend C++/Wt server I needed to use websockets (since the underlying Javascript that the browser interprets cannot use raw sockets).

 

It is pretty tricky to find a decent websocket library so if you have the time, I highly recommend implementing your own. However the best one I found was (http://websocketserver.de) which once you cut the Lua out of it is much cleaner than the rest.

 

With minimal changes this websocket server can work alongside the Wt library. As for communicating with a database (which is pretty necessary for players to save their game / scores etc since javascript is unable to save locally*), I used sqlite and there were no complexities getting it working alongside websocketserver.de or Wt. I imagine something like MariaDB or Postgres will have no issues either.

 

*HTML5 might be able to store data in cookies or even using a certain API that a couple of the latest browsers support but I don't know if Emscripten can access that directly without inlining some Javascript into your program.

0

Share this post


Link to post
Share on other sites

I've been using Dart (https://www.dartlang.org/) for a webgl project over the last couple of weeks and i can really recommend it. It has a really clean syntax that is easy to pick up if you're coming from a c++ or java background. Also, it compiles into native (super optimized) javascript which makes browser compability a non-issue. 

0

Share this post


Link to post
Share on other sites

Thanks Karsten_,

 

I'll get the websocketserver running next. I don't think I will be rolling my own socket server too soon though.

0

Share this post


Link to post
Share on other sites

thank you for all the replies!

 

I guess I should look at Dartlang as well...

 

I'm getting terribly frustrated. Wt is more than I want; so much API to decipher to get the pieces I want. cpp-netlib is about the level I want to be working from, but doesnt intend to support websocket, and I'm not sure I want to stick myself without that option. Poco is about the same as Wt, which are both a bit more bloat than I think I need (both following the Qt idea). 

 

Maybe just use boost & write my own everything? I wasn't planning on going there (mostly for lack of experience), but it seems like the only way to get what I want.

 

Now I'm looking at node.js with (or without) native plugins (plugins = more complication, but does allow me to write the meaty parts in C++), but how long will node.js be popular? On the surface, node.js looks fantastic, and I can certainly handle JS. But what will I have years down the road? A bunch of code written upon an outdated fad library?

 

So, I don't write code; I read webpages about libraries. I'm ready to poke my eyes out.

 

In the end, I want to build an App that either fires up http or websockets (prefereably as part of the application), and allows me to spit out webpage/JS/WEBGL.

 

In the majority of my reading, most people say this is not a job that C++ can fit into. I don't understand why. To me, and aside from the obvious JS requirement, C++ is an obvious choice for inclusion in a WEBGL/HTML5 game that would anticipate high volume.

 

Ok, back to poking my eyes out.

Edited by trowtlip
0

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