Jump to content
  • Advertisement

aganm

Member
  • Content Count

    149
  • Joined

  • Last visited

Community Reputation

32 Neutral

1 Follower

About aganm

  • Rank
    Member

Personal Information

  • Role
    Programmer
  • Interests
    Business
    Design
    Programming

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. You have no choice but to have some local model representation of your game in your client's memory. If you follow the client server architecture, the client should only use its data as a way to predict what is going to happen in the future so that it can be updated as fast as possible. As such, both the client and the server run the simulation of the game, but, the final state is decided by the server by broadcasting the lastest game state changes to your clients. Then, your client can either change nothing if its local representation is matching what the server told it, or it can override its data if it 'sailed' too far away from the server's state. That way, whatever changes is donne to your client's memory state doesn't matter because it will always be steered back on the right direction.
  2. aganm

    Character Modeling in Paint.NET

    Assuming you're in the US, or in a country with equivalent law of fair use, yes. The first rule of fair use law is wether you're creating something new or copying. If you're copying someone else's work verbatim, this is copyright infringement. If you're using someone else's work to help creating something new, this falls under fair use and is completely legal.
  3. Isn't 1.1 out of 4 possible clocks per cycle bad? In a heavy load benchmark scenario, my frametime is ~90ms on a 3570k. In regular gameplay, ~7ms. The game still has many more features to add to it. If I get these numbers with only 30% of the gameplay logic implemented, this means I could very well get near 30ms with the completed game. My code does jumps all the time to access data, only I'm struggling to understand how to properly arrange my data for best cache locality because of the complexity. Just for my first example where an entity shoots at another. I can't figure out how a random entity can figure out another random entity's position without automatically causing a cache miss. Maybe it's impossible, that's what I'm trying to figure out.
  4. 2. The target is another entity. My entities are layed out linearly in memory, so if entity #19 fires at #150, fire_at() has to jump back and forth these two. 1. fire_at() fetches the target's position, then spawns a projectile object flying towards it. Array all_entities; foreach (me in all_entities) { me.fire_at(me.target) { float2 origin = this.pos; float2 destination = target->position; // cache miss // if the array keeps its internal data before the entities, may // cause another cache miss if iterated entity is too far away // since push back will have to increment some sort of counter, // which must access some other location in memory all_entities.push_back( // array has to access the end of the array to put this data into, // which may cause a cache miss if the end of the array is far from // the iterated entity. Bullet(origin, destination)); } } The spawning of a new object might sound worse than fetching a position, but both are problematic for the same reason: causing cache misses. The position fetch causes a cache miss because I access the target's position directly which is probably far in memory. So, maybe I can cache the target's position close to the shooter, but how? If I just make a copy of target's position, then I still am gonna have a cache miss when making the copy. Or I could make a copy only once in a while, except it's not gonna be accurate anymore because it could have moved by then. 3. I am dealing with actual scale. I have implemented some time slicing, but it's not enough. Really I wish to understand how I can organize my data layout better. I feel like I missed something.
  5. I do. It's either I have to reduce the scale of the game, or fix my cache misses. For profiling, I used perf on linux perf stat -B -e cache-references,cache-misses,cycles,instructions,branches,faults,migrations ./game Result 1,218,347,798 cache-references:u 587,238,750 cache-misses:u # 48.200 % of all cache refs 162,551,053,111 cycles:u 179,079,789,818 instructions:u # 1.10 insn per cycle 23,451,271,748 branches:u 211,403 faults:u 0 migrations:u 70.633332501 seconds time elapsed 50.257961000 seconds user 4.669893000 seconds sys 48.2% of all cache refs are misses, this seems incredibly high. Note that I compiled with highest level of compiler optimisation.
  6. I have a list of entities and components which I iterate over in the game loop. Those entities are more often than not NPCs which can fire at each other from a distance. First NPCs are assigned a target by the overseeing AI which decides which target is the most appropriate for each NPC. Then, I iterate over each NPC to compute the firing logic at their target. Can you see the cache misses right here? In pseudo code: foreach (entity, all_entities) { // accessed linearly // target is another entity in the linear structure, but it could be anywhere. // from the next entity in the list, to the one a couple megabytes in RAM away entity.fire_at(entity.target) } How do I rid my code of such cache misses? Most of my logic relies on accessing random memory addresses like this and I've been struggling to refactor.
  7. aganm

    Linux IDEs for C++

    Netbeans C++ is probably the most fleshed out one. Though on linux, you don't need an IDE because the OS itself is an IDE. You just need to learn the proper tools as @Alberth mentionned.
  8. aganm

    Template Function

    It is possible, though not without some quirks and is not exactly straightforward. http://www.angelcode.com/angelscript/sdk/docs/manual/doc_adv_template.html A different solution is to add a specific interface for each type. // Template is longer to type Velocity@ vel = entity.getComponent<Velocity>(); // than a specific inteface. Velocity@ vel = entity.getVelocity(); There's two advantages to that. First, once the interfaces are there, your code is easier to write because less characters to type every time. Second, it is by default a lot more efficient than templates because AngelScript templates are determined at runtime unless you override a template specialisation for each different type. (see Template specializations in the link above).
  9. aganm

    How to make art like that?

    This is really great @Scouting Ninja, thanks a lot for the effort. I'm reading your tutorials along way the book I mentioned. I'll show some results as soon as possible.
  10. It would only be changeable in between battles. I agree that it may affect the quality of the game. I'll try your advice and see how this goes.
  11. One thing I do when I have lots of entities that can do the same action at once is wait a random delay before doing the action. That way, it looks a lot more natural and the sound problem is lessened. If you have a large map, then you will naturally use positional sound effects which will reduce the volume of sounds that are far from you if not mute them. If it's still too loud and lots of sounds happen all the time, I will lower the volume simply. If few sounds happen, it's fine if they are quiet because it gives auditive strength to the more intense action. For limiting the number of sounds, I presume that you count how many sounds are currently playing and skip newer sounds if it reached a limit. Instead of playing sounds directly, send a sound event to a sound manager. This sound manager will receive events from everywhere it's needed and it will keep track of the number of received events for each individual sound. Once the sound manager has received all the events for this current frame, it will decide which sounds should be played. For example, if I count 100 events to play the sound "laser_gun", I can play the sound once, but adjust the volume with the following algorithm. for each (soundEvent) { // Each additional sound event increases the volume by 5% // instead of 100% if you'd play it twice. float vol = 1.f + (soundEvent.counter - 1) * 0.05f; SoundAPI.play_sound(soundEvent.sound, vol); } That way, many sounds are still louder, yet not too loud. Notice that I used a linear function to increase the volume, but you could use an exponential function so that a second sound event increases the volume by 50% and the tenth only increases by 5%, etc.
  12. aganm

    How to make art like that?

    Good info. I started learning blender with the wiki book Noob To Pro. I've readed all of section 1, though it's only about basics and interface. What I had in mind is to make characters with the same general shape so that they can be rigged to the same skeleton. I want to make 1 animated skeleton and be able to use it to animate multiple characters and export them into spritesheets. Is that possible with blender? Also, could you describe how you've done your vector character? Is the whole model 1 piece? Did you made each pieces separately? What kind of lighting did you render with? I'd love to see in action how you go through that process.
  13. aganm

    How to make art like that?

    That's pretty cool. When I think of vector graphics, I always thought of inkscape and illustrator. What is the advantage of using a modelling software like Blender?
  14. I saw a video which uses elegant and simple art at the same time which I'd love my game to look like. https://youtu.be/P5e7cl19Ha0 The art seems so simple that it looks easy, and I tried, but I have very little art skill and I can't do something as good. Is this kind of art doable by a non-art person? How can I learn to do that? How long can I improve from zero art skill to making good simple art like that? I say simple from an non-artist point of view, but is it? What kind of software do artists use to draw and animate characters like that?
  15. Option 3 and 1 seems the same but with different wordings. Those would be the most straightforward. I like option 2, but does it make sense in your game? It would if your game has an ethic mechanic like mass effect series which makes you bad or good depending on your actions (or Baldurs Gate which is THE ethics RPG).
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!