Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 20 Mar 2012
Offline Last Active Today, 11:26 AM

#5316184 Estimating the performance of my application a priori?

Posted by on Yesterday, 03:01 AM

This is taking premature optimization to a whole new level.

I know people often bring up that Knuth quote .. but in my experience while you need to beware the pitfalls, it can be a very good idea to try and think about an efficient approach to your whole problem from the start. There are many failed projects and businesses as a result of not taking the time to think carefully about the best way of solving a problem before diving in.


Alright, you probably won't get it right first time, and you typically will end up redoing it several times until you come up with your current 'best solution', but you can save yourself a lot of wasted time. And the big point the 'premature optimization' argument kind of misses is that in many business environments you might not even get the opportunity to refactor it (try explaining software development to a bunch of clueless money crunchers), you might only get one shot.


Typically you need to liaise with a programmer and get them to write some test stuff for the kind of calculations you will be doing on each unit, to get any idea of how many is practical, and design around that.


But other than that, your problem domain is a little vague for us to give specific recommendations. For instance, is this a scientific application? Are the results of each unit required to be correct and calculated, or can they be estimated? Is it running on one machine? Or multiple? GPU, multithreading etc etc.

#5315293 How the hell do you even get people to play your game? Tired everything!

Posted by on 15 October 2016 - 02:46 AM

I won't disagree it's an absolute slog getting downloads .. some of it is pure marketing, which is quite different from developing, and I personally find a bit morally distasteful. <_< But there you go it's a large part of the battle, unless you happen to go viral.


That said, on first look at your game, my thoughts would be:


1) Where's the graphics?

2) What makes it different from umpteen million similar games?


Yeah, and as said, lack of video was a thing too.


Programmer art is great for development, but realistically it is not likely to get you downloads. On 2, if it is in fact similar to umpteen million games (let's face it for most games, a lot of mechanics are non-original), what about putting a slant on it, like making it trump and clinton or something topical.

#5315291 An alternative to "namespaces"

Posted by on 15 October 2016 - 02:30 AM

Personally at the moment I use prefixes (and short descriptive names), for the same reasons you are suggesting .. writing too much 'faff' boilerplate code (you might end up using macros / tricks to reduce this).


But I think it depends what you are writing, if I were writing a library for others to use, I'd namespace everything, to prevent name conflicts and delineate code. And also when working with a team it can make sense to help prevent programmers stepping on each others toes.


It isn't such a massive task to refactor in / out namespaces, so I'm a big fan of going with what makes you more productive. :P Although I'm sure there are zealots who wouldn't write a 'hello world' without a namespace.

#5313694 How much money should I ask for a game development from a publisher?

Posted by on 03 October 2016 - 05:43 AM

Are there even 'publishers' for this kind of low budget game nowadays? I always assumed that aside from specialist stuff like webgames, to get any kind of market you would be doing it for iOS / android, in which case surely you would be using google / apple to 'publish' (they just take a cut).


If what you mean is you need a cash advance for development, you don't necessarily need a publisher you just need an investor / investors, in which case there are other options like crowdfunding sites, casinos etc. I get the impression most people at this level self fund.

#5309025 Need a very simple collision detection for walls. ( 3d )

Posted by on 01 September 2016 - 11:26 AM

Depending on your game design, you might be able to use a navigation mesh:



This can greatly simplify and accelerate your collision detection, and allow path finding too.

#5304832 Adequate Windows Operating System Testing

Posted by on 09 August 2016 - 01:11 AM

To start with I'd get an old PC / emulator running your lowest target, and thoroughly debug it on that. That won't cost much, if anything, and should identify a lot of possible problems, to start with.

#5298851 Preparing a 3d game as a demo for my CV.

Posted by on 03 July 2016 - 01:11 AM

braindigitalis, collada supports animation, too. The problem is that I don't know how to load it into OpenGL.

lawnjelly, I already have the animation data from Blender, i have the file, I just don't have any idea how to parse it.


And I cant use vertex tweening, I need to use skeletal animation, because this is how I make my animations in Blender.

'Having a file' means nothing *unless* you can parse it. A quick google of collada suggests it may be overly difficult to parse.



Hint: Skeletal animation is often used to create the data for vertex tweening.

#5298814 Preparing a 3d game as a demo for my CV.

Posted by on 02 July 2016 - 11:00 AM

But to load it into OpenGL, it is really above my skill level. I didn't find any code on the internet that loads collada files into opengl. I can't find sufficient info on the internet about skeletal animation and how exactly everything works, there are just a few articles that touch the subject on the surface, but nothing more.( or I'm just stupid)


To state the obvious but the one of the best ways to increase your skill level is to try new things out. Programming is all about this. :D


Think about things logically:

  1. Are you being realistic about what you can achieve in the time frames? If yes...
  2. You need animation data from blender. Either you need to parse some 3rd party format, or export the data into your own format. Have a look at the source code for blender python addons for exporting. It isn't a great stretch to learn some basic python (which is icky!) and export what you need.
  3. Consider what kind of animation you want. If you are starting out, I'd recommend starting just exporting 'vertex tweening animation', which means just export the position of each vertex on each frame, rather than the bones / skinning stuff. Vertex tweening is much easier to get working, and is not too daunting a task to write a shader for in the game.


Getting bones animation working is usually the final solution used for character animation, but is quite tricky / finicky to debug, and not something I'd recommend until you understand tweening. Tweening can of course be used for character animation too, and was used in many games back in the day (quake 3 etc), it just has some drawbacks such as memory use and lack of flexibility for animation blending.

#5297343 Artefacts in triangle mesh

Posted by on 20 June 2016 - 12:51 PM

Ok with a .obj I could finally load it in blender to see what was going on.


Here is the before pic:




Here, I cutaway all the polys around the smoothing group of interest. This was the diagnostic test I suggested earlier. It cures the problem. This suggests it is because of shared vertex normals between faces across the blade. :)




Solution, in blender, along with make sharp (which you already have done successfully), was to add an edge split modifier, set to split edges on the 'sharp' marked edges. This forces the geometry to be split, so there is more than one vertex normal along the edge. Thus the vertex normal can be closer to the face and doesn't have to approximate between 2 wildly different faces with different face normals:



I'm sure there must be some setting you need to make in Max to get the smoothing group to 'do its thing' (I am not a 3d studio user), because it doesn't seem to be.


And here is a more clear explanation, I've set blender to show vertex normals. Here is the original file. The normals at the side of the blade are *shared* between faces pointing in opposite directions, so it just averages, which makes it look icky on a sharp edge.



This is after the edge split, which splits the geometry so there is a separate vertex normal for each face on the edge. Notice how the normal now points more towards the face, so you get the sharp edge you are looking for.


#5296937 Artefacts in triangle mesh

Posted by on 17 June 2016 - 05:09 AM

For one, this is why we have normal maps. You can bake nice normals at a super high poly resolution. Your real issue is just not enough edge loops.


Anytime you have a vertex that is on an edge that is 90 degrees, or close to it, you need to create loops around it, otherwise it is interpolation lighting over such high angles. Also, this is why you usually apply sub surface division and then back normals onto low poly meshes. For this same type of reason. More polys = better surface representation and lighting.



Isn't the whole point of smoothing groups so you avoid having to manually create an edge loop though? Note I've only used blender, and 'make sharp' on an edge does (I think) the same thing, it internally forces a duplicate of vertices on edges so they can have different normals and not share the same normal.


To figure out what is happening, you could delete all the polys outside the smoothing group you have marked in red, and see if the 'artefacts' persist. At least you will know then whether it has been caused by the shared normals, or some issue in the red group mesh.


[just checked in blender and you also need the edge split modifier in addition to 'make sharp', sorry for any confusion :) ]

#5296682 Real find job in game industry with my 2d skill level ?

Posted by on 15 June 2016 - 10:35 AM

I think they are very good, show a lot of promise. :)


In my opinion as well as 2d, you should buy / beg / steal something like zbrush, mudbox, mari, maya, 3d studio max or even blender, so you can familiarise yourself with how your skills would translate to an asset creation pipeline. Don't get me wrong, there is often a need for straight 2d art, but you will be so much more marketable if you can use the same techniques with tools for texture painting / sculpting.

#5067111 Difference between software engineer and programmer

Posted by on 03 June 2013 - 09:15 AM

Job title inflation, imo.wink.png




It's like calling a toilet cleaner a 'sanitation engineer'.

#5034102 Game engine Memory Manager

Posted by on 19 February 2013 - 04:47 AM




(don't hate me for using singletons smile.png the engine only uses two) 


Two too many.

#5034100 Game engine Memory Manager

Posted by on 19 February 2013 - 04:44 AM

In my experience, tight memory management can be incredibly useful in certain situations, on certain platforms, and less necessary in others.


Keeping tight control of memory is particularly useful on things like consoles, devices with limited memory, and especially situations where there is no swapping to disk to page in 'extra memory' when you run out. In these situations, if you run out of memory, either your application handles it gracefully (says 'cannot do this' or whatever) or you get a crash.


Certain applications, like games and rocket control software, or plane autopilots, I see as more 'mission critical' so I don't want them to fail or crash under any circumstances. Whereas for e.g. a word processor, it is more acceptable when trying to load a document if it says 'cannot load document, not enough memory on this device' (although obviously you'd try and design to prevent this happening). But playing a game it's no good if it says 'cannot load level 5, out of memory', as you cannot progress in the game.wacko.png


So for games that are anything other than very simple ones, myself I would tend to use a memory manager. However, for general applications / editors etc which have to adapt to what particular document / documents they are editing, where they are allowed to 'fail' due to out of memory errors, I'm much more likely to just use directly or indirectly the OS allocators.smile.png


If you do preallocate blocks of memory for each of your game 'modules', you are right in saying it is useful in advance to know how much memory to allocate. Preallocating blocks for different modules can be very useful when you need to work to a memory budget, particularly with a team of programmers, rather than just putting it all together and 'hoping it doesn't run out of memory'. For some areas, this will be easy to workout (e.g max number of sound buffers, things like that). 


For others, particularly game level resources, the memory requirements may change from level to level. You may want certain levels to have more sound data than others, some more texture data, etc etc. However, a way around this, rather than having set limits for sound data / textures / geometry etc, is to have these data shared in a 'level file'. And have a certain maximum size for your level file data.cool.png


For tracking memory leaks, as the others say, just because you are using your own allocator it doesn't automatically 'fix' leaks. However, you should design your allocator so that along with the allocation it can store things like the line number and filename (in some type of debug build). Then on exit, you can report any allocations unfreed after cleanup, and other statistics, like the maximum memory used in each module etc.


You can also put 'check' regions of a few bytes around allocations, to detect when you have written outside of bounds, off the end of arrays etc.ph34r.png


There are also 3rd party systems you can use for most of this leak detection and bounds checking. Although these may not be available on your target platform .. so having your own can be very useful. It's the kind of thing you can write once and reuse in other projects, and great to have in your 'toolbox'.

#5030400 pointers while serializing

Posted by on 09 February 2013 - 10:32 AM

You can also store the pointers as offsets from the start of a structure.


Then when you load this structure into memory, you can 'fixup' the pointers by adding the offset to the actual memory address of the start of the loaded structure and saving the result back, and voila, your pointers are valid again.


0 Start of structure
1 Pointer to Chicken (offset 3)
2 Pointer to Duck (offset 6)
3 Chicken
4 ..
5 ..
6 Duck
7 ..
8 ..