Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!

We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Member Since 18 Oct 2007
Offline Last Active Today, 01:38 AM

#5194083 Proper C++ header file?

Posted by Satharis on Yesterday, 11:25 PM

It's not portable because even though the compilers support it, there is no guarantee that they all function the same between compilers.

There's no guarentee of that basically anywhere in the C++ language, most of the standard is worded very vaguely and usually specifies only the minimum behavior that something has to do to be standards compliant. The only argument you even seem to be making here is that there isn't a standard definition of the basic things that pragma once must do(because it isn't a standard directive) even though it has shown to accomplish the same basic goal just fine across a variety of compilers.

In short you're basically saying we should avoid using it because it isn't standard, which is not a compelling reason IMO.

#5193971 Proper C++ header file?

Posted by Satharis on Yesterday, 08:39 AM

The reason I brought it up was because we're in the "For Beginners" section, where we try to be as exact and correct as possible.

Which we are, the only thing I agree with so far is that yes, it is non-standard, it isn't specified in the standard.

There are also a lot of students reading this section, and students are often instructed to follow standards.

Okay.. that means following standards their teachers set them. What I'm writing is an application of good programming standards, not commonly followed standards. I certainly wouldn't recommend everyone go around throwing macros in everything just because a student comes in here with their teacher having asked for some giant macro horror page for their next assignment.

If we want to talk about common, pragma once is probably one of the most common non-standardized preprocessor directives.

For them, using non-standard pragmas could cost marks.

Or it might not, depends on the teacher, which is why they are being taught right now that pragma once is a useful tool and you should prefer to use it if you can, not to always default to #ifndef header guards because they might be more pragmatically correct to a teacher. Not everyone here is a student.

I certainly appreciate the point you're trying to make, but I'm also trying to make one that we shouldn't just go "Okay, everyone do it the old fashioned way."

#5193917 Bringing it all Together (What's next for a beginner?)

Posted by Satharis on 20 November 2014 - 11:53 PM

What is it you WANT to make? All I see is a lot of "random things I have done, tell me what I should be doing." If you want to make a game or something then advice would come a lot easier than being so vague.


Your comments about becoming homeless in two months are not a big help either, if you need money that bad I would be putting in job applications now(really.. any kind of job..,) programming jobs are notoriously hard to get without experience, especially without a degree of some kind, I wouldn't bet everything on making some amazing thing in two months that will get you a job or something. Programming is like math, best carried out while not stressed about a barbarian invasion at your doorstep.

#5193916 Proper C++ header file?

Posted by Satharis on 20 November 2014 - 11:48 PM


I would also suggest to replace







#pragma once


it's simpler and you don't need the #endif at the end smile.png


The only problem with it is that it is not part of the C/C++ standard, so while it is supported by major compilers, it can't be guaranteed to always work.


Which is not a problem, just a thing to keep in mind. In fact pragma once is supported by every compiler that you would know the name of off the top of your head.


Frankly I don't see a reason not to use it unless someone specifically asks you not to, like at a job or something. Wasted opportunity to give more information to the preprocessor.

#5191746 Need some recomendations

Posted by Satharis on 07 November 2014 - 08:03 PM

Considering how vague and generic your questions are I'm gonna go ahead and sum up what quite a few people are trying to get across to you:


You aren't ready to make the kind of project you're asking about.


Will you ever be? Possibly. I would say you should set your sights a little lower and decide on a more realistic goal. Unity can definitely make many other kinds of games if thats what you're interested in doing.

#5188274 Starting Slow

Posted by Satharis on 21 October 2014 - 03:45 AM

Depends really, something like a puzzle game is going to be the most simple in general cases.

Usually compexity for games goes down to a few factors:

  • Is there a lot of realtime action? That requires level staging, collision detection, physics, stuff like that.
  • Is it multiplayer? Networking adds significant complexity especially in the area of synching things up.
  • Does it have complex gameplay?(A strategy game could fit that bill or not, depending on what kind of strategy game it is.)

If you need ideas you might go through an appstore or something, see what people are playing a lot of and is popular and try to figure out the most simplistic type of game you could work on.


Things like strategy games tend to have a lot of UI elements to deal with, so that can add complexity as well, especially if you're trying to make it "feel good" on mobile.

#5188221 Switching IDE, having issue with "code completion"?

Posted by Satharis on 20 October 2014 - 07:10 PM

Because VS is using allot of stuff that's non standard, and after we tried converting a project which has ~10k lines from VS project to Code::Blocks and CodeLite we had a job on our hands, and also we couldn't all work on it at same time, so the "Non standard" of the VS is so bad, i won't use the IDE. Even thou it can be set up to be using ISO. I did not find a easy tutorial so i decided to switch as well.

Non-standard? How is VS non-standard? What specifically are you referring to? In terms of C++ a lot of the standard is generally very vague and will vary a lot from compiler to compiler.

#5188220 Starting Game Development Questions

Posted by Satharis on 20 October 2014 - 07:06 PM

1) 2D or 3D? It seems to be a lot easier to make a 2D game rather than a 3D game because it eliminates a lot of tedious work, but would it be best to start out with a 2D game, and eventually turn it into a 3D game?

2D is generally easier.. but that's mainly due to the fact that people usually make much simpler games in 2D than 3D. Either can have great complexity and in general most of the deep down systems will be almost identical between the two.

But 2D is usually better to start with because it removes some of the burden from you, 3D does add some concepts to things like how objects interact, collision detection, physics becomes an issue.. things like that. The main point to make is that if you learn 2D first a lot of the concepts you get to practice there will transfer to 3D as well.

2) What language? I would prefer Java, and would like to make a game in Java (as it is my first, and really only language), but I've heard it isn't that powerful and can be limiting at times.

The golden question!.. the answer being.. it depends. If you said you were just getting into college and wanted to work at some big AAA company when you graduate I would probably highly push a language like C++, but since you're just making games to make games and you already have experience with Java, you could certainly use it.

Java is in general, going to be slower than the ideal C++ implementation. I'm sure someone will disagree but that's kind of a point to get out of the way. But with that said, that probably won't even become noticable unless you were making a very complex game, like a 3D fps with all kinds of fancy rendering and such where dealing with memory could be make or break for your game.

Basically.. use what you want to.

3) Engines. I'm not too familiar with game engines, but is it easier to use an existing one (and have to learn that engine), or to build your own? I would like to build my own, but I know it may be a bit tricky and time consuming.

Again, it depends. As far as I know there aren't really any full "engines" for Java that are wildly available, stuff like slick is more like a framework library. It's definitely better to use a library like that than to start from scratch, trying to learn to make every little thing at once is just asking for failure. If you make multiple games you'll begin to naturally learn how each subsystem works and how you could make your own implementation anyway.

4) What are some general steps to making a game? For example, what obstacles should be tackled first?

Sit down and think about what you want to make, even if its just sitting there with notepad and typing out the game idea and the different parts, I find this makes you think about a lot of things that you would forget otherwise. The nitty gritty details of how to make your game communicate internally can be nightmarish, like figuring out how you want to split the game up into screens, how screens will communicate with each other, what kind of data you need and how to load it.

Number one rule I've found though.. don't overengineer, pretend someone hired you to make the game you have in mind and sit there and think "how can I reasonably reach this goal, what tools will my code need before I start fleshing it out." Stuff like that.

#5160450 What to do now?

Posted by Satharis on 14 June 2014 - 01:36 AM

What advice would you like to give me?

Set realistic goals.

It sounds like you're either getting frustrated or just tired of working on the same project. Spending 5 months just getting rendering working is a little strange to be honest, unless you've been working at it VERY rarely.

What I would do:

-Decide if you're fine with adding a lot more code to your game, if you are, then sit down and figure out what your goals are with your game. If you're having trouble deciding what to work on then do the "what would I play" test, think about the order of things you can add to your game that will make it fun to play around with. Is the game going to have enemies to shoot? Well networking is probably second of importance then if you can't even shoot enemies or be killed yet. Is it all networked and only PVP? Networking is probably a higher priority then so you can start testing the actual mechanics.

-If you feel like you're gonna snap if you keep working on your game for much longer, then sit down and think how you could round the game off. You could probably do without sound for example, or some very basic sound, focus on adding the few features to the game to make it more like a game. If anything the worst part of putting months of work into a project is the temptation to just abandon it, at least make it so when you pop it open again in the future it acts like a game.

Personally I would focus on making the shooting game have actual shooting and defeating enemies before the other stuff, add stuff either in gameplay order or in the order that most interests you if you're working by yourself.

#5159709 I hate my code....How do you structure your code for a game?

Posted by Satharis on 11 June 2014 - 02:55 AM

In my opinion the most important thing you need to tell yourself while coding(at least the one that bothers me the most) is that your code won't ever be perfect.

Personally if I don't end up rewriting lots of code or second guessing myself I at least THINK about doing it. A lot of people preach a lot of best practices here, and they are good to follow, but in reality the only real rule about coding a game is that the game has to work. Its a thing that a lot of us tend to forget and get hung up a lot on specifics. A lot of code for AAA games that seem all professional and nice are tangled webs of awfulness sporting every bad coding practice you ever have seen.

So basically, even if it nags at you crazy that you are being a bad coder, just try to focus on making it work and then thinking of ways to improve it later on.

#5158273 Is working in terminal/console really a waste of time?

Posted by Satharis on 04 June 2014 - 10:05 PM

It was not my intent for this to become a language/ide/OS flame war. I simply wanted to see if I was being antiquated in not agreeing with his point of view. I have always thought of anything you can program as a learning experience, but saw so many say it was a waste that I started to wonder. This thread has made me realize that I'm not antiquated at all, but seem to be among many that think it is a very good thing to learn if only just to have the experience. Thank you all for your feedback on that matter.

The whole "everything is worth learning" line is rather nonsense in reality. If we all had unlimited lives and unlimited time that might ring true but the reality is in many cases, especially when teaching yourself, that you are going to sacrifice learning one thing in order to learn another.

There is the completely realistic possibility that a new programmer could spend 6 months making console based games when they could have been making 2d ones instead, and although they would likely have learned a few things making those console games, I would say the experience gained from making the graphical one would be much more beneficial in the long run.

More experience always tends to be helpful, but not if it has opportunity cost. Its not like making console games past the very basics of learning a language is like learning arithemtic for math. You don't need to know how to make a roguelike in order to make a graphical game. Everything is worth learning but some things are more valuable to your productivity than others, if your goal is to make 3D games you don't necessarily need to master the console to begin that.

#5158044 Do all 2D games do this?

Posted by Satharis on 04 June 2014 - 03:05 AM

2) How do I know how many tiles my computer is capable of rendering?

You might as well be asking us how far you can throw a baseball. Even if we knew specific details about you it is very hard to quantify such a thing, there are too many variables involved. Nobody really "knows" how much fps you'll get in different situations, thats why performance is often guaged off of benchmarking on a few different hardware setups.

A better line of thinking is to draw as many as you want, and if you run into performance problems then look at your options(cutting down on rendering, improving performance through profiling, etc.)

#5156851 how to design my programs and games structure?

Posted by Satharis on 29 May 2014 - 05:50 PM

Structure is probably the entire challenge of programming IMO. When you know what you want to do its usually trivial to just write out the directions to do it, designing how everything will come together is really the heart of the puzzle.

#5156655 Selecting a new slot for an item in an inventory.

Posted by Satharis on 29 May 2014 - 02:42 AM

You probably should seriously reconsider your code design if you need a comment on every line or every few lines explaining what each thing is doing. Even if your code is meant to be a tutorial or something its a little overboard.

The only time you should really have to use comments in code is to explain -intent- of something rather than trying to write out what an actual line of code is doing. It makes a lot more sense to explain that a couple lines of code are a safeguard against potential hacks than it does to write a couple lines of comments explaining that line 27 puts some object into a list for some reason and then line 29 loops through it looking for some character you don't want, or whatever your case may be.

I recently commented on a similar topic to this about inventory in a game, as was stated above the presentation should really be seperate from the data, thats a concept that is very common in game development. Pretty much everything can be split up into: receive input, do logic, present results.

#5155313 How to make a simple unity2d inventory system

Posted by Satharis on 22 May 2014 - 07:21 PM

This question would probably best be asked on a Unity related forum, I don't have Unity experience in particular but a bit of advice about a generic inventory system.


Usually an inventory is little more than an array/collection of references to game objects, the actual implementation of building the inventory itself doesn't have anything to do with graphics or the platform really. Usually you'd make a class that represents an inventory, it'd have specific "interface" methods that allow you to interact with the inventory(sort it, add items to it, remove items, get an item in a particular slot) and your player object or something may contain an inventory object as part of its definition.


The only real part that would really be different in unity would be the graphical aspect, this varies a lot based on the game. For instance if you wanted to do something like Minecraft or a typical MMO or something where you have a "slot" based inventory where you drag pictures around, then you'd have an object representing an image slot of an item that could be dragged between slots in an inventory gui window, releasing an item would instruct the inventory to move the item(in code) so on, so forth.


The mechanical backend of any inventory will be similar across the board however, that should give you an idea of where to begin looking at least.