Skills and Screen problem

Been a little while since my last post. I have worked on the skills. There is a skill class with all the variables that will do most of the math (and there will be a LOT of it). Actions will mostly be Strings in an ArrayList which will be unlocked as soon as some variables are high enough. There is an updater in the skill class that makes that check. Later on, I think I will have the Skill as top class which gathers all the "subskills", like fighting skills, woodcraft skills etc... . Just because I like to keep my classes small and structured.

Continue reading

Field of View

Field of View is very important decision for any game. How will it be rendered? What will the player be able to see?

I decided to make it very easy, by Raytracing. I have only a 2 dimensional space, so this should not pose a performance problem. I had to copy the basics by around 90% from a tutorial, but seriously... there aren't so many different ways on how to define a point or a Line. The Field of View now goes through each Point of a Line and tells if the tile is visible or not. Everything depends on a) the Vision radius, b) the tile itself and c) obstacles. For every point on the perimeter (of the vision's radius), a new Line is created. Then, for each line, we go from the player towards the end point.

Continue reading

Save and Load – success

Seriously, I thought I would have to pick it up again at a later point, but after drinking a good sip of whiskey, I finally found the right solution.

My problem with saving and loading the world object (which contains a two-dimensional array of WorldCells, aswell as a two-dimensional array of the Tile (enum)). I totally started it the wrong way. I wanted it to output into an xml file. I used XStream for the serialization and deserialization. It gave me an xml file, 38 mb huge and of course readable and editable, which I didnt want. I succeeded, after many hours, to save the world as I wanted it, but then - this was my biggest problem- I couldn't load the file back. I was browsing the web for hours reading about enum converters and stuff. All too complicated!

Today I sat down and after 10 minutes I was done.
What did I do?
It's easy:

Continue reading