FAQ  •  Register  •  Login

Experienced programmer would like some tips

Moderator: Some Guy



Posts: 1

Joined: Sat Sep 30, 2017 11:56 am

Post Sat Sep 30, 2017 12:11 pm

Experienced programmer would like some tips

Hi Snodd,

I'm thinking about writing a (not for profit, purely having a mess around) game. I'm a technical architect (focusing mainly on enterprise ecommerce, lots of Java dev experience), with a fair amount of experience with other languages (mainly JS and Python). I haven't written a game before.

The idea is essentially a virtual hacking game. Whilst doing a little research, the key main scene elements have a number of similarities to Galimulator, and I'd be really grateful if you could point me in the right technical direction for a things as I'm completely new to game design.

Overview of technical concepts that I’d like some direction on:
- Essentially the main scene would be nodes and vertices in 3 dimensions with each of the nodes (or groups of nodes) competing for dominance
- Procedural generation of the graphs and nodes
- Manipulation of the scene would be through a perspective camera. Zooming, lateral camera movement (or to predefined viewpoints) and camera orbits
- Nodes would 'fight' for dominance
- Nodes would be classes with different changeable (and some final) variables
- Ideally, similar to Galimulator, nodes could launch or animate an attack - I'm not sure about this yet or just have node vs node battles at this point (not sure of the mechanism - some advice in the events vs loops section below would be greatly appreciated). If that were to be the case, it would be nice to include some animation - nice to have at this point

Languages and applications:
- I'd prefer the platform to be mobile based
- I was thinking LibGDX or (preferably) Unity. No direct experience with either. I'll be starting playing now
- Ideally with a online mechanism (either 'room' based' or globally persistent) - Will come much later
- This will AI will also feature heavily - Will come much later. I've got lots of experience with machine learning, so am happy about the concepts for the time being. Applying to game design will come later

Procedural generation:
- I'm fine with this - Seeded generation of the graph with appropriately weighted distributions across 3 dimensions. This is what led me to Galimulator. I've got a prototype using Three.js and am happy with this as a technical concept in either LibGDX or unity
- I feel confident that I could setup the objects, I may need a little more direction when rendering certain elements at different zooming levels. Eg, frustum culling is fine, but I'd ideally like to change the object view based on camera distance, eg, far away nodes could be a simple 2d sprite, the same node close to the camera could be a high polygon object
- Also, visualising sovereignty is key. I'm really impressed with how you've done it. Do you essentially extrude a shape from your nodes, where the extrusions overlap, create plane of common between the nodes, then remove the affected area from your extruded shape? This looks as though it is generated and included as part of the original procedural generation. I'm interested in your thoughts on this

Events vs loops:
- One of the things I'm not used to from a programming perspective is the rendering loop. What would be the best approach for calculating something like a battle, eg, would you:
○ Run the logic for node battles as part of each rendering loop
○ Run the logic for node battles as part of a loop outside of the rendering loop (different thread) but your rendering loop always renders the state of the nodes
○ Create queues / events (with timers) for each node (eg, battle takes 1500ms, 30% success rate), manage those events, those events affect and update the node objects, the rendering loop always renders the state of the nodes - This feels much more natural from an abstraction perspective, but I'm not sure about the impact of rendering performance
○ Or something completely different. This is a key consideration for me and I'm really interested if you could point me in the right direction
- If you have been using timers or event queues, I'd be interested in some of the libraries that you've been using

I have other questions and my mind is buzzing! I'll start having a play with LibGDX over the next few days with a 2D version of what I am planning, but I would greatly appreciate your direction, please feel to respond privately!



User avatar

Site Admin

Posts: 867

Joined: Mon Apr 18, 2016 3:35 am

Post Sun Oct 01, 2017 7:44 am

Re: Experienced programmer would like some tips

Hi! Interesting topic, and an interesting game! :) I don't have time currently to give you the in-depth replies you deserve, but I'll give you some now and try to get back to you.

First off, I would rather recommend Unity. LibGDX is fine, but it's messy to port to iOS, at least it was messy for me. Unity seems to have this better covered. Plus, lots more modules etc. But if you really fancy Java, or don't care about porting to other platforms, then go with libgdx.

For visualization of "sovereignty", check out Voronoi diagrams! There are plenty of algorithms for this, I believe they support 3d as well. Then, just do a union of the polygons you get and some arbitrary "max" territory size (in my case an octagon or something), and voila! It's not that hard :) It's pretty expensive though, so save the polygon for each node, and just change color of it. Then you need to do things like borders, and that gets a bit more hairy. Make sure to keep track of neighbouring nodes from the Voronoi algorithm.

As for logic vs. rendering. I'd really give this some thought if I were you. Galimulator does everything in the rendering loop, both game logic and rendering. This is the simplest, but completely sumboptimal in some many ways. Adding allows you to render e.g. user map animations smoothly even when some part of the game is number crunching. So higher virtual FPS. But the complexity explodes when you add threads, so yeah, be careful with that :)

If you are just playing around for fun, I would just go with the simple approach. But given the relative success of Galimulator, I would rather look back and re-make that decision now :)

Other general advice that I do not need to tell you as an experienced developer: Use libraries whenever you can, and don't invent as many wheels as I did. Use the libgdx ui components, use stages all of that. Don't make you own, I promise you, it's not worth it ;)

Good luck! Please keep me updated on what you get up to, and feel free to post more questions if you have them, I will try to find time to reply :)
One man Galimulator developer and public relations army

Return to Off topic

Who is online

Users browsing this forum: ensumoumnfh, Oretriree, Petreamsvr and 6 guests