I added progress bars for exp to the status window. In order to do so, I "objectified" the progress bars, so I can reuse them for other things.
Tuesday, May 15, 2012
Saturday, May 12, 2012
Window managing
I created a simple window managing system. A button bar in the upper right corner can be used to show and hide windows. Every window got a header bar with a close button which hides the window.
Friday, May 11, 2012
Status window
This is the new status window.
Thanks to jQuery, it is drag-able across the canvas. I also used jQuery to make some other parts of the client code more readable.
Tuesday, April 24, 2012
Can jQuery help me?
I am currently checking out jQuery to see what the hype is all about and if I can use it to make the client work better.
Features I could use:
Features I could use:
- Selectors - I already thought about an own alias function for the annoyingly verbose document.getElementById.
- Position for centering divs properly. Also maybe for some other things.
- Tabs - I already have an implementation of a tabbed container for the chat, but maybe I could make it better with JQuery.
- Drag & Drop - For inventory handling and putting spells into the quick bar
- Sortable for inventory handling (maybe)
- Resizable GUI windows
Friday, April 20, 2012
Game system software architecture
Before I start with Milestone 6, which is about the implementation of a game system, I decided to do some refactoring first.
To allow quick and easy changes to my game system, all logic related to it should be concentrated at one place: A GameSystem class which implements all the game rules. All the provisoric existing logic needs to be removed and replaced with calls to this class. The game system does of course need the system-specific stats of all the participants like mobs and players. Storing this data in the existing objects would be a violation of the principle to isolate the game system. So every participant now gets a gameSystemDelegate object with all the game system specific data which is received from the GameSystem during construction and is passed to every call to GameSystem instead of the original object.
To allow easy replacement of the game system, I decided to follow the principle of dependency injection and the strategy pattern. GameSystem as well as the delegates GameSystemPlayer and GameSystemMob are only interfaces. The implementing class Wizardwar is only referenced in the main class, where it is used for a global GameSystem object referenced everywhere else. The implementations of the delegates, WizardwarPlayer and WizardwarMob, are only referenced in Wizardwar.
That way I could create an entirely new game system, and the only place in the engine code where I need to make a change is the line gameSystem = new Wizardwar() in the Main class.
About the wizardwar package itself: I intend the delegates to be "dumb" data holders with all members set to public. All game logic should be contained in the Wizardwar class.
To allow quick and easy changes to my game system, all logic related to it should be concentrated at one place: A GameSystem class which implements all the game rules. All the provisoric existing logic needs to be removed and replaced with calls to this class. The game system does of course need the system-specific stats of all the participants like mobs and players. Storing this data in the existing objects would be a violation of the principle to isolate the game system. So every participant now gets a gameSystemDelegate object with all the game system specific data which is received from the GameSystem during construction and is passed to every call to GameSystem instead of the original object.
To allow easy replacement of the game system, I decided to follow the principle of dependency injection and the strategy pattern. GameSystem as well as the delegates GameSystemPlayer and GameSystemMob are only interfaces. The implementing class Wizardwar is only referenced in the main class, where it is used for a global GameSystem object referenced everywhere else. The implementations of the delegates, WizardwarPlayer and WizardwarMob, are only referenced in Wizardwar.
That way I could create an entirely new game system, and the only place in the engine code where I need to make a change is the line gameSystem = new Wizardwar() in the Main class.
About the wizardwar package itself: I intend the delegates to be "dumb" data holders with all members set to public. All game logic should be contained in the Wizardwar class.
Thursday, April 19, 2012
Fringe tiles work - Milestone 5 finished
The client can now display maps with multiple map layers, including a fringe layer where the draw order of the tiles is combined with the sprites. I implemented that by converting all non-null tiles on a layer named "Fringe" to map objects (or rather something similar which implements the same interface).
Client, server and map editor now work the way I intend. Now I theoretically got all the tools I need to start world building. All that is left are tiles and a world building plan.
Milestone 5 is hereby finished.
Tuesday, April 17, 2012
Blocking works
Reading the block map property from each tile works now. Entities with different ways of movement is untested, but should work.
The way of defining the walk properties of each tile of the tileset is a bit cumbersome: you add a tile property "walk" and as a value a hexadecimal value according to the table in my previous post. When you don't set a walk property for a tile, the default value 0xd (walkable for everything but swimmers) is used. This has two possible pitfalls:
The way of defining the walk properties of each tile of the tileset is a bit cumbersome: you add a tile property "walk" and as a value a hexadecimal value according to the table in my previous post. When you don't set a walk property for a tile, the default value 0xd (walkable for everything but swimmers) is used. This has two possible pitfalls:
- the hex values are hard to remember, so you can easily select a wrong one
- there is no visual indication which tile has which walkability
Warp loading works
Loading warps from the map files is also working.
Monster population should wait until milestone 6.
Still left are movement blocking and fringe objects.
Then I will have all basic technical requirements for building a game world and I can call milestone 5 finished.
Monster population should wait until milestone 6.
Still left are movement blocking and fringe objects.
Then I will have all basic technical requirements for building a game world and I can call milestone 5 finished.
Tileset loading
The client can now work with tilesets and doesn't require a separate image file for every tile type.
I did a small modification at the server to remove the relative paths from the tilesets in the JSON code provided by Tiled and leave only the filename. That way I don't have to worry about where to save the map files before copying them to the server. The drawback is that I can't organize my tilesets in directories, but I don't believe that I will have so many tilesets that this becomes a problem.
I did a small modification at the server to remove the relative paths from the tilesets in the JSON code provided by Tiled and leave only the filename. That way I don't have to worry about where to save the map files before copying them to the server. The drawback is that I can't organize my tilesets in directories, but I don't believe that I will have so many tilesets that this becomes a problem.
Sunday, April 15, 2012
Blocking tiles
| tile | walker (1) | swimmer (2) | flyer (4) | magic (8) | examples |
|---|---|---|---|---|---|
| F | shallow water | ||||
| E | X | deep water | |||
| D | X | normal ground | |||
| C | X | X | abyss; low fence or other chest-high obstacle | ||
| B | X | indoor, under overhang | |||
| A | X | X | river under bridge | ||
| 9 | X | X | gateway | ||
| 8 | X | X | X | grate, prison bars | |
| 7 | X | circle of protection on shallow water | |||
| 6 | X | X | circle of protection on deep water | ||
| 5 | X | X | circle of protection on normal ground | ||
| 4 | X | X | X | tree, high stone, other man-high obstacle | |
| 3 | X | X | ? | ||
| 2 | X | X | X | ? | |
| 1 | X | X | X | ? | |
| 0 | X | X | X | X | wall |
The column "magic" applies to spells which need a line-of-sight to be cast as well as to "ghost" type mobs / players. A being can have multiple forms of movement, like a harpy which can both walk and fly. These mobs are only blocked when all of their ways of movement are blocked. Or in computer terms:
if ((tile_bitfield & move_bitfield) == 0) tile=BLOCKED;
Having scenarios where players and enemies have different areas to walk on as well as shared areas where both can walk, could lead to some interesting gameplay situations.
I could also imagine some spells which turn a player into a fish, bird or ghost. This would mean that they can't use equipment anymore, but it would allow them some interesting new leveling strategies as well as open up some new areas. There could also be the ability to polymorph a player involuntarily when he is in an area which allows both types of movement. This could be used as a strategy in PvP. Or it could be the solution to some puzzles before the player acquired said spells.
One puzzle I have in mind is a river with a broken bridge. The river is populated by mermaid mobs which sometimes attack the players with a spell which turns them into a fish. To cross the river, the players need to walk into shallow water, provoke the mermaids to hit them with said spell, swim across the river into shallow water on the other side, and wait for the spell to wear off.
An advanced form of magic could allow players to walk on water or fly without sacrificing their ability to walk on land or have equipment. But this should be a lot more expensive for the player.
Subscribe to:
Posts (Atom)



