- Viewing Profile: Reputation: zfvesoljc
Community Stats
- Group Members
- Active Posts 50
- Profile Views 913
- Member Title Member
- Age 32 years old
- Birthday February 20, 1981
-
Gender
Male
User Tools
Contacts
zfvesoljc hasn't added any contacts yet.
#4985048 Sending char strings in structs
Posted by zfvesoljc
on 29 September 2012 - 08:01 AM
#4977094 Multithreading in games
Posted by zfvesoljc
on 06 September 2012 - 12:58 AM
Hm... Thank you.
That does have a point, but I wonder where I could create tasks to make use of at least 2 cores. Resource loading doesn't happen every frame.
Where ever you have N items to update, ie: 200 particle effects can be split into 4 tasks, where each one can update 50 particle effects.
#4973704 Processing game input
Posted by zfvesoljc
on 27 August 2012 - 02:21 AM
#4917686 required bit count at compile time
Posted by zfvesoljc
on 29 February 2012 - 04:50 AM
A very trivial way to get the number of necessary bits to store a value at compile time:
template<unsigned int N> struct number_of_bits { static const unsigned int value = 1 + number_of_bits<(N >> 1)>::value; }; template<> struct number_of_bits<0> { static const unsigned int value = 0; };
Use:int bits = number_of_bits<42>::value;
It's not very generic or error-safe, but it works under normal circumstances at least. Add whatever error-checking you feel is necessary, or modify to suite you needs.
Thank you!
#4917428 required bit count at compile time
Posted by zfvesoljc
on 28 February 2012 - 10:52 AM
HDD/RAM space is not a problem these days
Who said anything about storage? Believe it or not, there are still some parts of the world where network bandwidth is not abundant.
but you could use one bit flag to tell whether to read a full byte or 4bits
I'm not sure how this would help me. I want to save minimum number of bits required. It could be 2, 4, 7 or even 23. I just wanted to know, if anybody had a quick idea how to get number of minimum bits required based on some max value (at compile time).
#4917414 required bit count at compile time
Posted by zfvesoljc
on 28 February 2012 - 10:21 AM
Quit wasting your time on the triviality and work on making more/better code. Realistically you're likely to add more enum values over time; leave room for them.
I asked a specific question, trivial or not. And I can waste my time any way I want.
#4887922 Input manager, mapping functionality
Posted by zfvesoljc
on 26 November 2011 - 11:39 AM
Firstly, let’s say you have mapped a key to an action. B to jump.
But now you are in water. Remap the key to “swim”? Keep the key on “Jump” but add code to check if you are in water during a jump?
well, to avoid such problems, you can still give a more generic action name, like fire1, fire2, action1, action2, if you have clear action definitions that is
#4887025 Best way to load a mesh
Posted by zfvesoljc
on 23 November 2011 - 03:36 PM
#4884692 [C++] templates function specialization
Posted by zfvesoljc
on 16 November 2011 - 02:59 PM
Could you please specify what you mean by:
explicitly instantiate a Test<int> in the .cpp file?
all template code (function implementations for example) must go into header
#4884477 Data storage C
Posted by zfvesoljc
on 16 November 2011 - 01:50 AM
just a hint, if you have bitwise flags in an attribute, don't save the attribute as a value, save each flag on it's own. It can save you a lot of trouble
enum EAttr {
aActive = 1,
aVisible = 2,
aMagic = 4,
};
int attr;
// DONT
xml.Write( "attr", attr );
// DO
xml.Write( "active", attr & aActive );
xml.Write( "visible", attr & aVisible );
xml.Write( "magic", attr & aMagic );
#4884195 Opinions on particle system
Posted by zfvesoljc
on 15 November 2011 - 09:51 AM
Both emitter data and particle data have a bunch of evaluators (line/curve editor), which are driven with emitter/particle life, ie: size, color, alpha, velocity, gravity, etc... To get better re-usability, we've added "instance data", so that some specific options are not set (locked) on data, but there where data is used (ie: when emitter data is linked under effect data, an emitter instance data slot is created, under which the emitter data is linked).
Biggest problem we reached was when we tried to create fireworks effect - where a "particle" is also an emitter. We had to add the concept of child emitters. On a particle data we define a new emitter data link, and it's "active evaluator". This defines when the child emitter will be active in accordance to particle life. This way we can nest as much as wanted, but for sanity, memory and performance reasons the depth is limited to 3.
Each emitter can also hold various engine objects like lights, flares, sounds, etc... whose properties can be also evaluated (ie: light color, intensity and range).
The editor is written with inhouse UI (sadly
edit: current biggest wish by designers is ability to animate particle movement, so they can create fancy movement like spiral, tornado, etc.. we are probably just going to import animation keyframes from an external tool (ie: maya), and interpolate particle movement based on that. note, that this will be just the "base" particle position, something like:
newpos += animationdelta + (velocity * dt)
so that you can still modify the particle movement even if particle movement is animated
#4884185 How to design a state machine?
Posted by zfvesoljc
on 15 November 2011 - 09:23 AM
Am I on the right track, or there is improvement to it I can make.
Don't hard code it, create a data driven system, so you can write state machine data (states, actions/transitions, conditions) in a data file, so you can edit the state machine without code rebuilding.
- Home
- » Viewing Profile: Reputation: zfvesoljc

Find content