Sign in to follow this  
Followers 0

Program Concept Help Needed

4 posts in this topic

My friend and I are planning on starting a Warhammer 40K campaign, and I thought it might present an opportunity for me to put my (limited) C++ skill to work.  However, I'm finding it much more difficult to get it started, and I figured I could bounce it off the community for suggestions, ideas, and advice.


Basically, I need the program to simulate the galaxy for us.  I started a program, but I'm not sure my design is capable of what I need it to do.  Here's what I have:


I want Main to start by creating the galaxy.  It will run through a 3 dimensional array and create Solar Systems.  Each Solar System will consist of 2 to 12 planets, and each planet will consist of 3 to 7 territories.  Subsequent uses of the program will allow us to pull specific locations on the galactic map, as well as run through each solar system to determine random events such as planetary catastrophes, invasions, etc.  


I figure I'll have at least these classes:

A Galaxy class that holds a three dimensional array of Solar Systems.

A Solar System class that holds whether the system has been discovered, number of planets, controlling race, and other undetermined details.

A Planet class that holds 3-7 territories, a controlling race, climate, environmental details, etc.

A Territory class that holds resources per turn, strategic bonuses, and controlling factions.


From a generalized standpoint, do you have any suggestions on how you would go about doing this?  Are there any specific programming practices that I'll need (for example: arrays are obvious, and classes, I can see inheritance being useful, but not necessary . . . ) ?  Is it efficient to have Galaxy holding a 3 dimensional array of Solar Systems (I'm particularly uncertain about the areas of the array that simply don't have a Solar System, wouldn't this setup be allotting memory for a Solar System even though it should be non-existent?)?  Or would it be better to have it hold a bool (true = a solar system exists, false = undiscovered area) and an int (the int would be an index so we know which solar system is there)?


Anyway, I don't want to make the post too long.  I appreciate any suggestions, and, at the very least, hopefully it will bring up some new ideas and challenges for me and like-leveled programmers.




Share this post

Link to post
Share on other sites

Yes, it would waste memory. One question though is, how much. What is the density of your solarsystems in a galaxy. If its really high, I would consider using a 3d array, since the wasted memory is quite small. And its a very easy thing to work with. If not, then take a look at octree's Also, depending on the size of your galaxy, you might even be able to use an array of solar systems, and just store the coordinates for each. Not very efficient, but if an galaxy only have say 50-100 solar systems, it wont matter, since looping through the array is going to be very fast anyway.


Share this post

Link to post
Share on other sites

I would not allow you program to randomly generate your world.  As a programmer you need control.  Take the time to plan your universe and solar systems, this will give you consistency for future modifications.  Eventually if you wish to make it a Multi-player game over a LAN you will need everybody to be in the solar system.


However, If you wish to play this game yourself and do not want it to be to easy since you would know where everything is, then do this....

  1  -  Have your starting position be random when you first start your game.  Also make any AI Enemies Random through out you Universe.

  2  -  If Multiplayer, Make any guest's starting position Random - If the are joining a universe in progress everything else is the same.

  3  -  At the start of the game, make you PC aware of only their surroundings.  They must discover the rest of the universe through game interaction in order to travel to other planets.  In Other words, you might be aware of Planet X in the DeadZone Universe, But your Charactor has no knowlege ( Which is obviouse that is your goal )


Share this post

Link to post
Share on other sites

Mercurialol: The idea of the three dimensional array would be an x- y-axis with a z component representing depth.  This was my original thought for creating a three dimensional space that could represent a galaxy.  My concern is that every single [x][y][z] space would represent a Solar System which would include several planets, and each planet includes several territories.  With so much space for the galaxy, this could add up to a lot of memory.


Magnus Westin: This is an awesome suggestion, and I've never heard of octree.  I took some time to read the wiki article you provided at work today, and it definitely seems like it would be more efficient from a memory standpoint.  If I understand correctly, the first octree would be the galaxy, with the eight octants serving as maybe sectors, then subsectors, then planets, then territories.  I'll keep researching!


Poigahn: The level of randomization would strictly be limited to throwing in solar systems for a starting point.  From there, I'd like to have total control as to creating new solar systems of our own invention, as well as maintaining income, etc.  I'm not looking at having multiple users over a LAN, but it's something that might be useful.  Do you have any documentation I could read to research this?


Thanks for the replies!


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

  • Similar Content

    • By MetalTug
      I'm a college game design major, but I have also picked up on some basic programming.  I've done some stuff in Javascript, AS3, Visual Basic, Stencyl, and I'm now moving into using C# in Unity.  Just as a general programming question, what are some tricks/techniques that any programmer can do, regardless of coding language, to make sure that their game runs as smoothly as it possibly can, in terms of frame rate?
    • By Thyawesome1017
      I have experience with unity and C# script, I have also purchased the Google Developing Console to upload games to the play store. The problem I have faced is how much work and how tedious it is to complete a game on your own.  So if anyone wants to partner up on a simple 2D mobile game email me at
    • By HugoLOI
      Hello everyone,
          For those of you who are into puzzles, pixel arts and family stories, here is a game we started with my little brother:   Kingscape sets up a lonely character, the king's son, who invents off the wall adventures with numerous imaginary foes including but not limited to: cartoonish mad ducks, perverted zombies, bloodthirsty sales reps, explosive pigs. Your job is to defeat them all.   We're looking for positive criticism, feedback, toughts and support from people who enjoy the game pitch. Feel free to tell us what it evokes for you!     Cheers, Hugo Loi    
    • By kyuubi
      Hello everyone,
      We are looking for some talented artists to join our team in developing a new classic style adventure game.
      Open Positions
      Our team is currently looking for two artists, one 3D model artist and one 2D concept artist.
      2D Concept Artist
      Help us translate the concepts into visuals to improve our 3D model workflow
      3D Artist
      Help with creating 3D environments, buildings, props, dressing etc.
      3D Animator
      Someone that can bring our models to life and make them feel less static.
      What we are looking for
      We have a fun and talented team working on an ambitious project, but we need help in creating 3D assets. We need people with experience, comfortable with defining streamlined workflows and producing work in a quick pace.
      We also need someone to help bring our ideas to life in 2d concepts first to better improve our workflow in creating the 3D scenes.
      Although it is a hobbyist project, we take the project seriously and we are committed to finish the project, so we need people that can commit to the project with the goal to end it.
      The ideal candidate
      Is used to work for milestones and timelines Used to working in a collaborative approach within a team environment Has time available to be present on a regular basis, appear on slack and provide updates Can output work on a fast pace That understands what it means to work in a project The skills
      For 3D Modeler
      Skilled in creative 3D environments, including props and scene dressing Ideally that has worked with Unity before Bonus points if you have talent for character creation Bonus points if you have actually worked on a title until the end. Experience with Unity (double bonus) For 2D Concept Artist
      Experience with concept art Bonus point if you have created concepts for a game Bonus points if you have actually worked on a title until the end. Experience with Unity (double bonus) For 3D Animator
      Experience animating humanoids and animals Experience animating inanimate objects Experience animating environments (vegetation, ocean etc) Bonus point if you have created concepts for a game Bonus points if you have actually worked on a title until the end. Experience with Unity (double bonus) The Background
      The game takes place in a world almost submerged by water, where all the land that is left are small islands, where the remains of the human race try to survive after the cataclysm known as the Seven Tides.
      You play the story of Jon Riley, a young boy living in the Island of Chelonii, in the Eastern Kingdom of Khalandrie. After a visit from an old mysterious acquaintance, his grandfather, the only relative Jon has mysteriously disappears and Jon embarks on a quest to find what happened to him, while discovering the truth about himself, and the underlying mystery of the Island.
      For a full description of the game check out The Game page. (user: seventides pass: indie)
      The Mechanics
      The game will be mainly feed from the traditional mechanics of adventure games popular in the 90’s with games like The Broken Sword, Monkey Island, The Longest Journey, Full Throttle, The Dig etc.
      It also introduces some RPG elements that promote exploration in order to immerse the player deeper in the world. The main driver of the gameplay experience is going to be the story as it's traditional in this genre of games.
      The Art Style
      Currently the adopted art style is a flat shaded, low poly style. You can see some examples below and the full gallery here (user: seventides pass: indie). Please not all of the screens are work in progress as we are working in iterations to move faster.

      The Music
      We are lucky to have an amazing musician and talented producer in the team that is composing amazing musical scores for the game. If you want to hear some music samples get in touch!
      The Tools
      The game is being developed in Unity 5 in 3D low poly flat shade style. We are currently using the following main tools:
      Unity 5 - Game engine Dialog System - Dialog System for non linear interactive dialog databases Adventure Creator - State machine for the traditional adventure game workflows FMOD - Sound Engine Blender - 3D Modelling Sculptris - 3D Char sculpting Slack - Communication Trello - Task Management Our Trello Board!

      The Team
      We are a team mostly composed by professionals in our areas but new in applying our skills in game development.
      Game Designer/Project Lead - Background in Computer Science and working professionally as the technical director of a leading web development agency in Sydney. Duarte brings maturity in project management methodologies and technical leading. An obsessive adventure game player and very seasoned technologist, Duarte is the founder of the project. Lead Developer - A very experienced developer, Joao is the main man behind the implementation in the Unity engine. He will translate the specs and game design workflows into the engine. He is a professional web developer currently working in Vienna, Austria. Music Producer/Sound Design - A professional musician and music producer, Richard is a guru in enhancing the experience with sound and musical scores. He works professionally as a musician and music teacher and lives in London. 3D Artist/ Character Design - An aspiring musician and hobbyist game designer and 3D artist, Kevin is mainly responsible for character art. He currently lives in Puerto Rico. 3D Artist/ Environment Design - A hobbyist 3D artist, Joshua is mainly responsible for environment art, buildings, landscapes and props. He lives in London. If you are interested
      If you want to join the team, get in touch and I will supply the full game design document, our wiki containing character references, sound design cues etc and provide access to our Slack team chat.
      If you are interested contact me through private message.
      Looking forward to hear from you!
    • By Edoardo396
      Hi guys, I'm trying to make a crossword puzzle game for practice.
      Sorry but I've no idea on where to start.
      It should be basic game where the user must enter the word in the correct place and nothing else. (I am sure you know how to play crosswords!)
      I have to export it to Android and (if possible) to iOS.
      What engine would I want use?
      I thought to use Unity in order to develop it but I'm not very good with it (and, honestly, I don't like it that much)
      How is Unreal Engine 4 with Basic 2D Games like this one? If I could use UE4 it would be better because I know more C++ than C#. 
      I also thought about making this app with a "basic" IDE such as Android Studio (and) xCode but I would have to do the work twice and I want to avoid that if possible.
      Does anyone know if there is a library or something useful for making crossword games?
      Thank you very much for the answers and have a nice day!
      I apologize for the bad English but I'm not American/English.
  • Popular Now