Weekly Update #5 – Path Finding and GameAddons

We had a fairly productive week this time! Here a short list of things we did:

  • Last polishments on GUI system with respect to mouse and gamepad input. Works fairly well now.
  • Slightly improved controls of player – there are now less movement delays when switching in and out of aiming mode
  • Continued working on path finding
  • We refactored our game code to use GameAddons to extend the engine without hacking main.js too much.
  • Some concept arts for future characters – just the faces though
  • First steps toward a saving and loading the game state using local storage

A few details:

Path Finding

We managed to create the structure required to perform path finding search based on A*.
The Path Finding does not simply operate on a tile basis, as this would be too much of an overhead for this type of game.
However, we still use a tile map to create the way point structure of the map.

So for instance, for the following map…

path-finding-1

..we’ll create this tile structure:

path-finding-2

Each colored regions is a (more or less concave) area. Adjacent areas are connected. Areas without colors are not covered by the way-point-map. The arrows (lower part of the map) connect to way points of the upper layer.

When the map is loaded in the game, the tile map of the way points is compiled into a more simplified structure. Here, we simply connect each colored area with it’s neighbors, but also keep the precise edges on where the regions connect. Here a visualization of the final structure

path-finding-3

On that structure, we plan to run the A* algorithm. And that’s the next step!

GameAddons

Now the following is mostly interesting for people familiar with impact.js

As you might know, impact.js is designed fairly low-level and encourages extending the engine by simply overloading and extending methods of the game object, e.g. update() or draw(). So far, we did exactly that. On the other hand, we have started structuring our game code into something we call features. Features are implemented in seperat folders, extending the game with additional entities or singleton objects. The idea is: you can simply add or remove a feature by linking it with the game (via requires()). However, whenever the feature had to change something inside the game loop, we still had to hack the main.js in our game, calling functions of global features objects etc. So you could not simply add/remove a feature, you often had to modify main.js as well. The plug & play idea didn’t really work perfectly.

Now we solved this issue by implementing GameAddons. Features can now provide a GameAddon, which is automatically connected to the game and called on different points of the game loop (e.g. preUpdate, postUpdate, preDraw or postDraw) and only if required. With this, we finally get our plug & play features, that simply work on connection without any further coding.

If you are further interested in any of the implemented features, write a comment or mail and we might tell you more about it.

That’s all for now.
Until next week!

18 Comments

  • This is..... on February 18, 2013 at 9:18 pm said:

    Very nice my friends….

  • Me! Me! I’m interested in the GameAddons!

  • Ich verfolge das Projekt gespannt!
    Wenn die Vollversion eines Tages draussen ist, wie kann man sich das Spiel denn kaufen, wenn es auf HTML5 basiert? Kann HTML5 auf der Virtual Console einer Heimkonsole abgespielt werden oder ist es mit Ouya und Smartphones als App kompatibel? Oder bleibt es ein Browserspiel, in dem man einen gewissen Teil umsonst und gegen einen gekauften Account dann vollstaendig spielen kann?

    • Lachsen hier von RadicalFishGames.
      Virtual Console für Heimkonsolen ist fürs erste eher unwahrscheinlich, da hierfür der Code portiert werden muss.
      Für Smartphones und Ouya besteht die Möglichkeit, die HTML5 Anwendung direkt (bzw. im Rahmen eines passenden Frameworks) zu verwenden.
      In dem Sinne streben wir im Moment in erster Linie eine Browserversion, Smartphones und Ouya an.
      Das Finanzmodell steht bisher noch nicht fest, aber einmal kaufen und dann vollständig spielen ist wahrscheinlich.

  • Megalodactyl on February 28, 2013 at 7:46 pm said:

    I’m very interested in game addons!

  • Sounds like it could help mods be made. Whenstheinventorysystemgonnaletususepotions-

    The game is awesome, BTW. Is there any specific way the levels are designed?

    • There will be options in the real first Demo. What exactly do you like to change?

      We do plan the levels based on a plan where the place is and how it would look from the outside (like the cargo ship, maybe we can release a concept art for this :)).

      • I would first maybe add a jump button (not that it’s needed) for a ball attack that is a lot weaker but travels farther.

        Also, if you do do an inventory system, maybe you guys could assign two items (potions?) to the Q and E keys (because of closeness to WASD) to be used real-time without opening a menu.

        I wouldn’t change so much as add, you guys have done a really good job.

        • Adding a jump button will not happen (The auto-jumping is intended and we want this kinda Zelda-like jumping because it makes it easier to handle things.). We have plan for some sort of air attacks and equipment will make a ball bounce more often (or mabye a skill, we will see).

          We could actually do this. Q and E would be meta keys. Though you would have some advantage on PC (We still want to keep the possibilities open to release the game on mobile devices.).
          The TechDemo only shows some of the core aspects of the game but you can be sure we have more stuff that we want in the game!

          Thank you for the comment :)

          • Equipment’s gonna be in the game too? Then you are required to make at least one zelda item get reference. :)

            Wait, really? Awesome!
            You could say the same about minecraft with right/left clicking, but it worked for them.

            Well, then I can’t wait to see!

            (For the more recent post, can you explain how the energy balls work/rebound/disappear?)

          • Yes there will be equipment! Not sure if we going to make any Zelda references, but we might do since it would be fun to do :D

            Yes why not? It’s not such a bad Idea do have hotkeys on PC I guess. You have them in most games so it makes sense.

            What exactly do you want to know about the energy balls? How we doing the angle calculation or how the bouncing is controlled?

          • (this is for above because the reply button has vanished in a flurry of bug.)

            I imagine ‘you got the item! Now you don’t have to do these silly poses anymore!’ or something.

            I’m interested in how you calculate A: the damage given to an enemy, B: how you make the balls despawn, and C: how you calculate where to throw it.

          • No this is not a bug but a feature from WordPress. It limits the depth to to make it easier to read (You can watch the site on your mobile device too!).

            Okay, we will discuss this and you might see a technical post about it soon :D

  • And do you have any plans for a plot once bot-chan gets out of the cargo ship? Perhaps robot army controlled by generic evil guy?

    • We have a plot and it will not be a simple “evil guy has big robot-army (eggman hint)” :D

      The goal is a good and interesting story that makes you want to play all day!

  • Jonathan Cardoso JCM on March 31, 2013 at 5:01 am said:

    omg, amazing game you have here! Oh, make me remember of the good old days of me playing SNES. *-*

  • Angelixshadow on April 9, 2013 at 10:57 pm said:

    One word: Amazing!. The retro-style gives a deep touch in the background, and the game mechanics are very interesting, you have my support. One question, you will bring this game to the Wii U in the future?, BTW great job!.

One Trackback

  • By Path Finding in CrossCode | Radical Fish Games on April 28, 2013 at 11:31 pm

    […] NavMaps. We already discussed these structures (and how they are created in the level editor) in a previous weekly report. Nodes of our NavMaps cover multiple tiles and are connected with all adjacent nodes (called […]

Post a Reply to This is..... Cancel reply

Your email is kept private. Required fields are marked *