Thursday, July 28, 2011

Its been Awhile Heres Eracia v0.0.1f

Wow its been awhile since I updated, but here is my small update on Eracia:

1.) Finally got my light sources to work well and much faster than before.  The map  generator will start randomly putting torches in rooms and hallways.

2.) Started working on small support for Tiles.  This will be the last thing I honestly will be working on even if it never gets done.

3.) Started working on Player Input, Updating Entities, and updates to the map in a well polished MainGameLoop().

4.) Started cleaning up my classes and using encapsulation to a way that I feel is good.

5.) My map generator now deletes excess walls.

6.) Started working on The Title Screen and Character Creation Screen

7.) Started working on my Stats Class both Monsters and the Player will share this class.

8.) Worked on the Panels so I can show and hide them when needed. And made a Class that they inherit with the same functions.

9.) Started a better version of my input engine.

Monday, July 18, 2011

Some Cave Generation

This weekend I was struggling trying to create my map generation, so I finally researched the topic and came up with a few algorithms to use.  My cave like tunnel maps are going to be using my own version of the Cellular Automata algorithm.   After some tweaking and some different ideas I came with something that I can say is quite feasible.  

Here are some of the maps it generated:

   As you can see I still have some rooms that are not reachable but I am happy with the random "Tunnel look it gives.  Next steps:
  1. Find access to those pesky little rooms.
  2. Start creating support for the rooms add events.
  3. Start adding doors to areas that look food for it
  4. Adding lakes and rivers - bridges
  5. Find larger areas in the map and maybe create monsters fortresses.
   The possibilities are endless

Saturday, July 16, 2011

Map Generation First Idea Failed Time for Plan B

   My first plan in creating a Room Styled Dungeon was to create a map with random sized rooms and place them within the maps bounds.  This created maps that looked like this:

   Now granted this is random I didn't like the fact that the rooms where always squares and rectangles.  What if I wanted to make a L-shaped room bend around another room?  Also the way I did this was just making a text room and fill it in the map buffer.  The only way I could add doors and or corridors within these maps would be constant rereading of the map to find plausible places for doors and cooridors.


   So I created a Room class that holds tokens.  Tokens will be the connectors from one map to another, doors from one room to another, and other special events that can happen in a map.  Maybe a pit? A treasure chest that holds items?  And the Tokens placement within the room.  I am planning on adding scripts in Eracia later on, each room could hold multiple scripts, storyline, and epic battles.  
   The Room class will have an ID in the map it is within and the door tokens will tell the map which room the player is within.  This could help intelligent Monsters "hear" the player and run to stop our hero from achieving victory.  I could also add path nodes within each Room, so these intelligent monsters will know exactly where to go to stop our "noisy" hero.  The possibilities are endless! /brainstorm
   This is Plan B generation idea.  Start with one room givae it an ID of 1 and add the connector token from the map to the new one.  Place the Player Start token there so the Player don't start at 0, 0 or whatever other placement on last map was.  Maybe add some random items and or Monsters.  Now find a random place on the map, give it a shape add some noise to it so its not a perfect square or rectangle and place it in the map.  Write down some coordinates where its walls are and find a wall to place a door token.  Create another room with the door token from Room 1 and give it ID 2, again maybe add some random items or Monsters, maybe have it bend around room one?  Maybe create another Room to bend around Room 1? Or maybe start at Room 1 again and go another way?

   That is my next approach to this.  I hope to work on this tonight and have it finished by Monday.

Thursday, July 14, 2011

Update V0.0.2a And Map Templates

This is a small update of what I worked on yesterday.  Its not much but at least it is a small step forward:

  1. My Player now has a viewpoint where he / she has to map out the Maps.
  2. Started working on my Random Map Generator about .05% complete.
What I am thinking about is creating a data class that has information about the current map I wish for it to create, Im calling this class TemplateMap.  Within the class it will tell the generator:
  1. The Map Type such as: A dungeon, a cave, a forest. There are more
  2. The Map Look such as: Create the map looking like a circle, a square, or a long horizontal but small vertical map. There are more
  3. Map Tone: The major colors to use for the current map.  Should the map have more greens than blues?  Maybe the character is deep underground and hes starting to see lava?  Or maybe he is walking through a burning forest?
  4. The characters to use for Walls, walkable tiles and Tiles that will block the player's view such as pillars.
  5. The min and max size of the map.
  6. To add Rivers or lakes and how many.
  7. The Player's viewsize in this map.  Outside maps view should be much smaller than in a town.
  8. The min and max amount of rooms to add to the map.
At the moment the TemplateMap class holds these values and I am having the Map Generator read the values and deal with the data that the TemplateMap tells it.  I wish to add some more to the TemplateMap later but I want to really dive deep into the Generator first.

Wednesday, July 13, 2011

Slow Few Days

The last few days I've had no time to work on Eracia.  I will be getting back to it as soon as I can.

Friday, July 8, 2011

Code Clean-up Friday

Well I think I'm going to dedicate Fridays to cleaning up Eracia's code.  I believe this is a good idea.  ATM I have 13 different classes with many different calls to each other.  Even though the game runs well with the 1500 - 2000 lines of code; I want to find the bad ideas before I have 10000 - 20000 lines of code to traverse through.

Thursday, July 7, 2011

Update v0.0.1b

Update v0.0.1b:
  1. Added Keyboard support for the arrow keys
  2. Created Map class and it can create a very crude random Map
  3. Player can move his token around in the map
  4. The Map scrolls with the player
  5. The walls block the players movement
Its a small update but at least I got a map finally!

Wednesday, July 6, 2011

Events and Entities Display and Im Still Alive!

Finally after three days I got the EventLog and the EntityList to work.  There is always room for improvements.

So far The EventLog supports:
  1. Messages Like the first line.
  2. Multiple Entity lines.
  3. Actions
  4. Scrolls from the bottom up
  5. Certain words will be different colors
  6. Entity names will be their colors
Things I still wish to work on:
  1. Make the EventLog scrollable atm it erases anything after the twelfth line
  2. Word wrap atm if a event is more than 80 characters longer it will give an out of bounds error
  3. More Dynamic messages.
The EntityList supports:
  1. The Entity's name
  2. The Entity's Symbol
  3. The Entity's Color
  4. Stacks with like Entities
  5. Supports up to 12 different Entities
Things I wish to work on:
  1. Make it Scrollable also, atm if all 12 lines have entities it just does nothing for its addEntity method
  2. ATM I dont have any methods that will delete an Entity from the list.  I really should add that.
All the Events, Entities and Player Stats are Dummy test data to see if things work.

Here is a screen shot so far:

Saturday, July 2, 2011

First real Status Panel pic

Alright I created my second attempt at my Stats Panel in Eracia.  For the colors Red means you have less than the base of the stat, green means you have more and white means there is no difference between the stat and its base.

For The stats Str - Cha the next number stands for the difference between the stat and its base.

There is always room for improvement but at the moment it works so Im going to move on to The bottom Panel which will hold the Event Log and the Entity List.

Friday, July 1, 2011

UI Progress

Sadly I did not get any time to work on Eracia yesterday; however, today I went full force.  I deleted everything to do with Java's JLabels and created my own class that inherited from Java's JPanel.  With playing around I am able to draw text of different colors to my new JPanels.  At the moment I am creating a TextBuffer which holds all the characters and their colors and drawing them to the Panels.  The Stats Panel is almost done and tomorrow I will work on the Event Panel and Entity Panel.
   Soon I will start making the Map Panel display a map TextBuffer and hopefully can start making my random generation code.  I hope that is as fun as it sounds!