AGX Update #14

Welcome back to another update, just a bit late this time. Sorry!

So, as i’ve said in the previous update (#13), I’ve had a problem : I couldn’t make a proper bridge over water. It’s now fixed / possible! Thanksfully, i didn’t had to break any files to add that feature. See the screenshots.

At the same time, i added the multiple collision rectangles per tile to the engine. Works fine! Again, see the screenshots. With it, i can now add hills and elevated plateaux, and movements on it should feels natural. Currently, i have 2 rectangles per tile, but i can add up to 4 if i o so wish for it.

I’ve updated the Tileset Editor to allow the setup of many collision rects, and i now can draw the rectangle with the mouse, instead of typing the coordinates (although i still can type it). Similarly, i’ve updated the Autotile Editor, and now i got a simple check box that tell if an autotile is blocking or not. This may cause me some trouble, as there is a few autotiles that allow to move inside but at certain condition (an example being the roof inside of an house).

This week, i will take it off to FINALLY play Diablo III, but expect an update in two weeks, promise!

I now leave you with a few screenshots!

AGX Update #13

Hello! Here’s an update, as usual and on time!

This week, the update shall be pretty thin on the news. I should stop being so lazy. For what i lack in content, i’ll instead supply my ideas for the near and semi-far future.

First off, i went on and finished the map format. I’ve added an actual header section, set right after the version value. In the header, i’ve also added a way to skip over sections, and a short map name, unrelated to any language, ex: “fld_castle_01″. This will help me identify maps when handling events, and within the editor. The actual name (visible ingame if needed) would be saved in a language file with his own system to grab the correct name, depending on what language the user want.

Meanwhile, in the AGX World Editor, i added a way to export my tilesets/autotiles files to the game directory, while cleaning them off and validating their content. I’m using XML format for these files, and i think i could go with something more compact. Maybe. For now, they aren’t getting much big nor hard to read, so i let them be.

For the collision manager, i do think i’ll have to go with two or even three collision rectangles per tile. When trying to have a tile where 2 or more sides need to be impassable, there’s a bit of troubles doing so with only one rectangle. However, to improve performance, i can perfectly ignore rectangles that are empty.

Another problem arose when i tried to make a bridge over water — since the unit can’t walk over water and since i check ALL rectangles of collision for all of the tile’s layers, it doesn’t matter if i put a passable bridge tile over the water, units can’t walk on water and that’s final. So, to remedy this, i’ll modify the collision handling so that a tileset’s tile can decide to ignore the collision rectangles of all the layers below it. Sorry if i’m a bit confusing.

Also, i’m going to focus a lot on improving the AGX World Editor, so that i can, for example, decide the map size, change a map’s name, import tilesets/autotiles and create a project with his own separate tilesets/autotiles/maps.

On an unrelated note : 8 days until Diablo III ! Still can’t wait.

Take care, and see you next week !

AGX Update #12

Hello again, and welcome to yet another update!

It’s been three month now that i’m on the development of the actual AGX engine. I can say i did more than i ever did on an RPG engine over the last 4 years. Indeed, AGX hasn’t been my only attempt at it, but is by far the best i’ve gone.

This week, i managed to do the collision manager. It seems to not cause much if any performance hit, but that’s probably because i tested with only the player on the screen and a normal map. I guess it will show a bit more with tens or more units frantically running about. Just to mention, units ignore the collision of other units, for now.

I’ve finished cleaning up the controls, some of it being a little tricky somehow (checkbox, i glare at thee!) but in the end, it looks good.

I’ve modified the Tileset Editor so that we can now see the collision rectangle, in a zoomed in visualisation of the selected tile. I intend in the near futur, to add a second collision rectangle per tile, just to be a bit more flexible.

Finally, i rewrote the map file format so that i won’t have to break files if i wish to add contents to it. While doing so, i maximized the size the tiles were taking. Instead of taking 7 bytes (and 13 bytes if the tile was an autotile), it now take 4 bytes, 6 if autotile. For comparison purpose, 4 bytes is as large as a single Integer (int32). So, my test map (50x50x5) which was 25 Kb is now 14 Kb. Pretty neat! I intend to add some more stuff into the map file, such as regions (i’ll discuss that in another blog entry), npcs and links to various events. I’ve also added the version number of the AGX lib to the map file so that i know if the file need to be converted or treated in a special way.

The modification of the map format caused some side effects, however. The first being that a map can’t be bigger than 255×255 and 255 layers. We can all agree that 255 layers if far more than needed. The reason why the limit is 255 is because i store the size of the map in a byte, and various pointers for each tiles is also using bytes. And the byte limit is 256 (minus 1 because i use a limiter somehow).

The other side effect is the amount of tilesets and autotiles i can use. Since i store the index of the tileset/autotile in a single signed byte (ranging from -127 to 127 instead of 0 to 255) for every tiles, i can only have at most 126 different tilesets and 126 different autotiles. This is still fairly large, and i feel like the limitation isn’t much a concern. Using that byte, i can easily tell if a tile is an autotile or not (the value is in the negative? autotile index, otherwise it’s a tileset index), and so no space is wasted!

On a more personnal note, i pre-ordered Diablo III. I can’t wait. Days feel like months. You probably know the feeling, like waiting for Christmas or your birthday as a kid. :)

Sorry if there’s yet again no screenshots — i’m not really doing anything right now that produce visible stuff.

See you again next week !.

AGX Update #11

Time for another update, not really big, not too small either.

I’ve got distracted by something, this week : I got a graphic card (Nvidia Geforce 430 GT), which is a significant upgrade from the integrated Intel HD Graphics i had before. So i spent a lot of time playing games that didn’t work and / or couldn’t play nicely (Skyrim, GTA4, The Saboteur).

As for the AGX engine, it now allow me to test the XNA4′s HiDef profile. I doubt it will be really useful, as i’m not making a graphically advanced game engine, so i’ll probably keep to the Reach profile.

Now for the actual AGX update, i’ve made the Unit Manager, which now control the player, update all units registered to it, and control the camera. I had to modify a bit the map viewer so that it draw all the units. However, i’ve yet to make it smartly ignore the units that aren’t visible. But since the Unit Manager also contains the camera, it shouldn’t be too hard.

While writing the Unit Manager, i’ve modified the Unit object so that their rectangle of collision is clearer, in preparation for the Collision Manager.

Lastly, i’ve vastly modified some controls that created a texture on the fly, which ultimately wasn’t much necessary, as they were causing crashes and offering no real performance boost. I’m still doing some maintenance on a few controls.

Next up : the collision manager, combine the unit / collision manager with a map to form a Level, fix/improve upon the controls system.

See you next week! (sorry, no screenshots; there’s nothing new to see…)

AGX Update #10

Hello and welcome to another update !

This update is smaller than the others. I encountered some troubles along the path.

First off, i basically rewrote the ingame map viewer. It went from around 80 fps on my humble machine to about 300, while now allowing autotiles to be shown.

I can now read and show correctly a map saved with the AGX World Editor, including per tile depth. I’m also reading and setting the collision rectangle of each tiles, but have yet to use them. The collision manager has proven to be arduous to make, so far.

I’ve also fixed a zooming problem. When scaling the camera matrix, i was also multiplying the depth, which caused some weird stuff to happen.

And finally, autotiles can be animated! It loop forever through four tiles (if there’s four tiles available), changing every 150 milliseconds or so. It makes rivers and waterfalls that much more lively.

For future development, i’m going to rewrite how i handle a unit / character so that i can have multiple of them on screen. I’m also going to re-arrange my class as to make a global “Level” class, which will contain a unit manager, a map and a collision manager. The three of them will work in harmony so that i can draw and update a level smartly.

Here’s a few screenshots, and see you next week !

AGX Update #9

Another week, another update!

First off, i’m renaming the usual updates to ‘AGX Update #X’. AGX is the name of my game engine, it stand for ‘Alta Games Xna’. Simple enough. When i’ll actively make a game, i’ll name the weekly update after it.

So, i left last week by saying i was trying to find out how to save and load maps. And i totally did it. Map files are now satisfyingly small and fast to read. A standard map of 50 tiles large and 15 tiles tall, with 5 layers will take about 5KB of space, up to around 9KB.

Next thing i did was to rewrite how i decided the depth of a tile, at a given position/layer. In the earlier implementation, i was relying on the current player’s position to determinate the depth. However, as i noticed, problems would arise when more than one unit was drawn. It’s now fixed, and much more coherent. Doing so, i also had to modify my Tileset Editor to reflect the changes.

In the Map Editor, i did several modifications. First one was to allow to make the currently selected layer to be brighter than other layers. Therefore, i had to make all other layers semi-transparent. It gives a pretty good effect, akin to how RMXP is doing the same thing. Non content to end things here, i also added another mode, which show only the current layer — all others are ignored.

Another thing i did within the Map Editor is to faithfully draw the map as how it would be shown ingame. Considering the depth changes i did, i guess that not seeing the same things in the map editor compared to what’s ingame would be confusing and/or a potential waste of time. So i did that.

As said before, i modified the Tileset Editor to better set the depth of the tiles. It’s now much streamlined, using only a bunch of radio buttons. I also did the Autotile Editor, which use a very similar setup.

Unfortunately, i’m getting some troubles with how i handle the player’s unit. I’m not so happy with it, so i think i’m going to revise it heavily. I’ll most likely create a UnitManager of some sort, so that i can draw the visible ones, update their position, direction, etc… That’ll probably take some times.

Next / at the same time, i’ll go and read a map file ingame, see if it work just as well. Then, i’ll check for a CollisionManager.

Until then, see you next week!

AGX Update #8

Well, it seems like i’m in time for another update!

As i said in the previous update, i’m building a World Editor, an external tool that let me edit anything related to the game. This week, i’ve been focusing on it, specifically.

Before i go on, to counter-act the lack of screenshots from the previous update, i’ve made even more screenshots this time around! Make sure to check them while you are reading.

First off, i finished the tileset manager. Well, most of it. I’ve yet to add the autotiles (check next paragraph for that), but that will come soon enough. With it, i can set a single rectangle of collision for each tiles, and set the layer depth, which will define how the tile should be drawn depending on any unit’s position.

While i’m using tilesets, i though i could also use Autotiles. These special tiles connect to eachothers within the same layer, to form a natural path or form. Thanksfully, i’ve made an experimentation a few months ago, and came up with a way to build these tiles using a skin format commonly used by RMXP..

While i’m talking of RMXP, if you look at the screenshots i made, yes i’m using the tilesets that comes with RMXP. No, i will not use it ingame. I will find free-to-use tilesets and autotiles.

I’ve managed to complete the map editor, aside of a few not so mendatory tools. I can change the currently working layer, i can select and apply from any amount of tilesets simultaenously on a single map and i can easily Undo/Redo any action.

What i’m up to now, is the save/load methods of a map. I’m trying to formulate a format that would be fitting, not too big, flexible for future changes, and not too complex. I’ll come up with something, that’s assured.

And now, for the screenshots! See you next week!

AGX Update #7

Time for another update on TFE ! And in time, woo !

First off, I’ve added depth within the map viewer. Depending on the position of a unit, tiles can be over or under him. It look and feel natural, and act exactly the way i wanted. I’ve also allowed tiles to be always over the unit (ex: walking under a tree). I could also modify the depth level of a unit and allow him to treat tiles that were over him as being on the same level, so that they can walk on a bridge, jump, etc. without having to rely on screwy mechanics.

Unfortunately, i haven’t managed yet to incorporate collision detection. However, i got some ideas about how it should be implemented. Basically, each tile would have one or more collision rectangle, instead of having a single one encompassing the whole tile (32×32). With the depth management commented above, it would give a more natural feeling to collisions, instead of feeling all ‘blockish’, an issue that is felt in RMXP/VX.

To add in collision, i’d rather do something else before, and that’s a World Editor. With that external tool, i would be able to create and edit tilesets informations, items, effects, npcs, scripts, maps… you name it, it’s here. I don’t think i’ll focus entirely on completing it, but i’ll surely go and add a little something now and then when i feel like necessary. As a side note, i don’t think i’ll give away the world editor. Time will tell, however.

Within the world editor, i’m currently doing a map editor and a tileset editor, as they are the current priority. I’m trying to keep a look & feel like RMXP. The map viewer is pretty much completed. Right now, i’m trying to complete the tileset viewer, with the possibility to select a rectangle of multiple tiles. Once it’s done, i’ll go and make tools, like ‘Apply Rectangle’, ‘Apply Fill (bucket)’, and ‘Apply Line’. Maybe even make a difference between ‘filled’ and ‘outlined’ rectangle. These objectives should take me some times.

Now for the smaller but interesting things, i’ve included a Faceset maker in the character generation screen. The face fit the character appearance, and i can give him some various expressions, like angry, happy, surprised, etc. it’s useful in dialogs, to convey the emotions of the characters. A good example of what is a faceset can be seen here : faceset. It’s the face in the dialog, obviously.

Also, i’ve yet to fix the obnoxious mouse problem (in windowed mode) i mentioned in the previous post. I’m not giving up on it. I’ll come back to it later, maybe with a clearer mind.

Finally, i’ve improved the InputBox control, so that i can be notified when the text is changed, and i also can filter the text, like allowing only alphanumeric characters.

I haven’t got much to show this week, so screw screenshots. :P I’ll make up for it next week.

See you all at the next update!

AGX Update #6

Welcome back to another instance of the weekly update! I’ll try to continue like this and not skip a week or two, okay? :)

First off, I worked on a way to reliably handle resolutions. As you may have seen in the tech demo #1 available in the previous post, Stuff looked out of place when using high resolution, and rather cramped when using low ones. All is fixed now, as i’m using a code sample from David Amador’s blog, thank you, if you read this! I’ve made a few modifications, but otherwise it lay untouched.

After that, i had a load of bugs related to the mouse, of which i also squished.. mostly. Somehow, there’s a small vertical offset when in windowed mode in certain resolutions. But it’s not crippling. Play in fullscreen for best experience, i’d say!

I’ve leaned on the question of memory management, and i think i came up with a solution. It’s not a panacea, but it’s a good step in the right direction. Basically, each screens have their own ressource, and when you go back a screen, these ressources are unloaded. I can easily unload all menu ressources in one fell swoop, such as when i’m going from the character generation screen to the ingame screen.

While we’re in the subject of screens, i also added a little sugar coating to it : When i show a new screen, i can decide to still show the previous screen, darkened, in background. It’s useful when showing an ingame menu, pausing, etc.

Finally, i fixed a zooming issue. Not much else to say, on that.

In the near future, i’d like to improve upon the map manager. Ideally, i’d like to have something that look and feel like a RMXP/VX game, except the characters wouldn’t be stuck on a grid. I’d like to add collision detection and better layering system (so that a character can go behind a tree, for example).

I’ll leave you with a few screenshots, sorry if there isn’t much more to show.. but hey, see you next week!

AGX Update #5

[EDIT : I've updated the demo, it no longer require to be installed.]
[EDIT#2 : I've re-uploaded the demo. Now, when you zoom in/out ingame, the camera properly follow you. Also added a "Enter your name" area in the character generation screen as to show the InputBox control, of which i forgot.]

Welcome back for another update on TFE ! Sorry for the wait.

As i said in a previous post, i wasn’t entirely happy with how i was handling the game. So, i rewrote it partially. I kept the dungeon generating tool, as it’s not linked with any graphic library, and remade the rest. This time around, i’m taking notes on game making with the help of this tutorial at XNAgpa. If you want to know, i’m at part 8.

Before i go on, i must tell you all that there’s a small tech demo available of what i’ve done so far, at the bottom of the post, with more informations.

What i’m doing right now is making a library, mostly containing controls, which are mostly used for GUI (graphical interface — button, list, checkbox, etc). I’ve followed much of the tutorial on these controls, but i’ve also done my owns, or improved upon what was presented.

Here’s a list of things i can do, listed by their class name :

  • Control : All controls inherit from this, since all controls have a set of similar attributes, like Text, Color, Font, Position, Size, Visible and Enabled. Also, all controls can align themselves in relation to any other controls.
  • Label : Allow to draw text at a certain position.
  • LinkLabel : Like a Label, but allow you to click on it.
  • CheckBox : Allow to check / uncheck a box, alongside a Label.
  • InputBox : Most complex control so far, allow you to type text. I had some trouble with this one.
  • Frame : Second most complex, allow to draw a frame with a background, using a skin. Some good example can be seen here, since i’m using the skins compatible with Rpg Maker VX.
  • LinkList : A list of LinkLabel, Aligned horizontally or vertically, with custom spacing between each item.
  • ControlGroup : Allow you to put together controls and do something to all of them, like moving them as a whole, showing/hiding them, etc.
  • PictureBox : Allow you to show an image, somewhere.
  • SettingsFile : It allow you to save / load settings and more in a XML file. That’s not a control, unlike all the rest of the list.

Aside of controls, like within the tutorial, i’m managing game screens and how to move between them, like the title screen, options screen, new character screen, gameplay screen, etc. It’s absurdly easy to manage, once it’s set.

As for TFE in itself, i though i would remodelize it a little. I think i could go another way with it. I still want it to be focused on dungeon crawling and turn-based battle, but not a rogue-like anymore. It’s mostly because of my desire to have an actual story, and the impracticality of turn-based movement in multiplayer mode. If my ideas does not fail me, the battle system could be a bit more original (compared to the classic Final Fantasy style). It also must allow a smooth multiplayer experience, which probably won’t be easy, but i’m up for it.

I’ve done a working prototype of a character generator. It allow you to choose the face, hair, cloth and (in the future) gender. I’m pretty happy with the result. It allow me to create unique-looking NPCs, too.

Finally, i’ve also done a crude map viewer, of which you can take your newly generated character for a stroll around the park. You can zoom out and in, except it doesn’t follow you nearly nicely as i’d want it to be.

Tech Demo

So, here’s a quick demo of what i’ve done so far.

There’s a couple things i must mention before you try it, like the background. No, the game hasn’t changed name to “Eyes of the dragon”. I’ll get my own background for the game later, as for now, i’m using the one provided in the tutorial i mentioned at the beginning.

There’s also an elusive bug of which i’m not sure if it’s related to my graphics card or not (or lack thereof, because i have an Intel HD Graphics). At random, the screen can go either black, or white with all texts appearing as squares. All inputs still work. I can’t find the reason why it’s happening, but i know how to fix it (press F12 to apply it); IF it happens to you too, PLEASE TELL ME, and mention the name of your graphic card. If you need help finding out the name of your GC, it’ll be my pleasure to help you!

There’s barely any keyboard handling — pretty much everything is handled with the mouse. I do not intent to lock myself out of a possible Xbox adaptation, so i did what i could to not mess things up.

Ingame, move with the WASD keys, zoom in/out with the mouse wheel, and press Escape to go back to the character generation screen. Anywhere in the game, press Printscreen to save a screenshot in the Screenshots directory of the game.

Download the Tech Demo #1 here : DOWNLOAD.

Make sure that you have .NET Framework version 4.0 installed, and XNA 4.0 redistributable installed too. Here’s all the links :

.NET Framework 4 (Web Installer)
XNA Framework Redistributable 4.0