Jump to content

  • Log In with Google      Sign In   
  • Create Account

the incredible smoker

Member Since 26 Nov 2013
Offline Last Active Aug 28 2016 06:59 AM

#5145685 I need help with matrices

Posted by on 09 April 2014 - 09:11 AM

I also use floats for everything, and in the render function build a matrix from it and render,

maybe you find it ugly, but it seems the way to go.

#5145679 Why a "Game" class?

Posted by on 09 April 2014 - 08:42 AM

Hello Frob,

I got voted down for these reasons about globals ?, i feel special now that i can handle it then.

Once the engine works like this, there is no more of these problems.


Anyways are using globals also slower ?


The point for me is that i have all data / pointers in 1 file ( ok 2 files ( cpp & h ) )

i like to make many games, so i dont have to hunt everything down when cleaning the engine.

Its realy comfortable, professors can discuss another decade about it, but it wont convince me.



#5145388 Why a "Game" class?

Posted by on 08 April 2014 - 09:53 AM

I love globals, so you only have to declare them once, also not passing in functions, just use external in the header file.

Next to game class i also have demomovie class, mainmenu, briefing, options, credits, etc etc.


#5137835 No Low Level Programming is better ?, Please explain this then ?

Posted by on 10 March 2014 - 10:30 AM

Hello, i was getting the advice that : low level optimalisations are bad.


Now i was reading : the new PS4 is not backwards compatible, because of the different architecture.


How does that rhyme ?,

Sounds to me they only use low level programming ???


i bet a hacker still can play old games on the new PS4.

But i know why Sony does stuff like this : They wanto sell you your games again that you already have, now as download.


They also sell ingame stuff, and game upgrades, i dont know if i still wanto call myself a gamer, if thats what a gamer is, someone who pays all the time.

Ill be waiting until the games are 5,- each, secondhand before buying a PS4,

if theres no more games available on CD with PS5, only downloads?, then i stop buying Sony Playstation.


If someone can explain to me about the low level programming?, i would feel better if they have a good reason,

but still it would be rediculous if the PS4 cannot play PS2 games, then they are doing it on purpose.





#5120868 float unlimited increasing rotation or use a if

Posted by on 03 January 2014 - 04:58 AM



as to opinions if this would result in general optymisations - some say no (and they belive compiler produce code better than you do) - some say yes (and they say that still compiler are silly to produce uneffective

code sometimes - 



Why does the compiler make float to int as fast as the assembly code i got from www.musicdsp.org ?

So having ASM is needed in my opinion.


Also its very handy if you program microcontrollers.



 If you still haven't gotten that point by now, perhaps you are trolling us.



Look at your own picture ? lol.



#5120727 float unlimited increasing rotation or use a if

Posted by on 02 January 2014 - 11:21 AM

Ok Simon, thanks for the explaining.

I will make a test soon, compiled in Release mode, and see what happens on both Celeron and i7 pc.


@ Madhed : What is meaned with high level optimalisation ?

something that is repeated 1000 times i am worrying about, if that is called low level optimalisation, then i am very confused.


I dont send you my engine but i have it like this, ( is this high level optimalisation ? )  :

every gamestate has its own class, and within the demomovie & game gamestate theres function pointers for each level.



#5120708 float unlimited increasing rotation or use a if

Posted by on 02 January 2014 - 10:13 AM

Look Alvaro : if i,m saying i have 1000 stuff inscreen they tell me not to brag.


I,m sorry : its about wheter the if is faster then the min(), not about how fast you can understand the code,

i would comment out the Original code above it, so dont worry please,

its just an example, not that i have it from my programming pc.


And about assembly programming : no thanks, i planned to not start with that, exept for the float to int code that i copyd, lol,

not that i dont need it, i would like to understand it, but i rather make a finished game.

#5120699 float unlimited increasing rotation or use a if

Posted by on 02 January 2014 - 09:39 AM

Ok Simon, how about this one :


x = min( x , 100 );




if( x > 100 )x = 100;


And thank you Fir.


#5120672 float unlimited increasing rotation or use a if

Posted by on 02 January 2014 - 06:01 AM

Why would the test be not correct ?


I test a few times, so its not that random, just a bit random, not every time exacts the same, but close enough to see its faster.

#5120283 float unlimited increasing rotation or use a if

Posted by on 31 December 2013 - 06:06 AM

I have this software Original complete package, so i have to use this.

I dont think i can use the newest version with my keycode.


My lookuptables are usually 16-bit 512 or max 1024 sometimes, i dont know if this is a issue.

And i will do for every function a test, not test just 1 function and say its faster or slower, ofcourse.

btw : I dont aim for i7 PCs, i like my game playable for everyone, also those without the best system,

i still like old games to, if i reach to something like a Dreamcast game i will be happy enough,

i bet there are enough people without a expensive game pc.


+ this topic costs me lots of points,  time to play screenshot showdown before reaching zero ( will i be banned then lol ? ).

Anyways : Happy newyear all!

#5120038 float unlimited increasing rotation or use a if

Posted by on 30 December 2013 - 10:26 AM

Let me tell like this : i have tested all this, get the time, repeat 1000 times, then get the time again.

Test showed me the simplest if was faster then functions, it was a while ago, i should test it again on my new pc maybe ?

Can a i7 be faster with sin() instead of a lookuptable? , and maybe a Celeron ( which is my current game development pc with onboard graphics ) cant ?



If you are asking this, you are in absolutely no position to be worrying about whether branching is faster than a math operation or not. You need a really thorough understanding of what is going on under the hood of your compiler if you want micro-optimisations to be anything other than a total waste of time.




If i worry about optimalization,i must be in some position, right ?

I have learned programming not on school, i also dont know how to use a debugger.

Is that a problem ?, i thought questions are never dumb, i skip learning everything that is not needed to get result, if i need something i can Always ask it.


But if you defending your own business, ofcourse you dont wanto tell the competition how to get your games optimized,

i,m telling you : games are not playable with functions like sin() and cos() and sqrtf() ( i still need to get some fast sqrtf function by the way ).


Note : i,m Always having 1000 bullets and explosions in screen, so maybe this does not count for your i7 pc with 2 bullet and 1 explosion ?



#5119863 Input on different thread

Posted by on 29 December 2013 - 11:14 AM

Input uses same thread as rendering logically.

#5119857 float unlimited increasing rotation or use a if

Posted by on 29 December 2013 - 10:43 AM

Thanks Waterlimon and Alvaro about the presision, i did not notice that yet, to be honest i have no clue whats the underlaying idea about float, i was just asking to be sure.

With this information i now know i need the "if", the "if" is faster then any function like fmod i,m sure.


Maybe you all dont worry much about CPU intensivity as i do, i like many things in screen, not just 1 circlesaw, maybe you all have a i7 instead of a celeron ?

By example : your better off with a "if" instead of a "min()" or "max()" in terms of CPU usage, i avoid everything to be honest.


greetings and thanks again

#5119838 float unlimited increasing rotation or use a if

Posted by on 29 December 2013 - 09:41 AM

I,m sorry i have no clue what you mean.

It also seems very CPU intensive, using a function like fmod ? ( i dont know what its for )

Normally i dont use functions like : sin() , cos() etc, fmod() looks something like that, very cpu intensive.

Note : i usually avoid divide to.


I,m asking to go with or without the if, and why ?



#5119825 float unlimited increasing rotation or use a if

Posted by on 29 December 2013 - 08:27 AM

Hi all, i have a question :

suppose i am making a wheel rotating :


float rot = 0.0f;


// in loop

rot += fElapsedtime;


it works fine like this, but the number gets unlimited bigger and bigger.


Now what is better for CPU performance?, using a if that limits the rotation ? :



// in loop

rot += fElapsedtime;

if( rot > Pi )rot -= Pi;


What is the better choise and why ?

thanks in advance