[On Hold] Magic Realm (out of publish Avalon Hill game)

Showcase your completed projects or get feedback about your work-in-progress

[On Hold] Magic Realm (out of publish Avalon Hill game)

Postby hardwarebob » Tue Jun 21, 2011 3:38 pm

I will be creating a PC version of an old board game, Magic Realm, the wiki link is below which gives a brief overview of it.
http://en.wikipedia.org/wiki/Magic_Realm

There is already one java port of this game, called RealmSpeak, but I would like to still do this project, as it will allow me to learn a lot about a new area of programming for me.

I started learning lua a little over a week ago, and boy what a surprise I was in for, as it certainly is not like the traditional OOP languages I am used to.

After going through the fantastic online resource, Programming in Lua (PIL) by Roberto Ierusalimschy, I am finally getting the swing of those tables and how to manipulate them to your advantage! I didn't even code anything for about a week, while I read up on the language and then created module and function outlines in a text file.

The game board is based on lots of tiles, which are large hexagons, so I also needed to research good methods on grid coord systems etc. Found a great site from 'Amit' http://www-cs-students.stanford.edu/~amitp/gameprog.html#hex with lots of great resources.

I just finished off my random tile placement scripts, so that the tiles are placed on the (at the moment imaginary, ie no graphics, just text) playing board at random coordinates next to each other, and with random rotation of each tile. This also had a few rules about placing tiles next to at least two other edges after the first two tiles were laid. So anyway, took a bit for me to nut it all out, but looks like a pretty concise set of code for doing all of this.

I was also impressed at how I could use the PIL example of importing data into the application from a simple text file, much easier than coding some xml parser!

I hope to upload some of the initial code here if people are interested in checking it out, I'm sure there are some things I can learn form your experience out there!
Last edited by hardwarebob on Wed May 16, 2012 12:06 am, edited 1 time in total.
hardwarebob
 
Posts: 44
Joined: Sun Jun 12, 2011 3:41 am

Re: Magic Realm (out of publish Avalon Hill game)

Postby Ivan » Tue Jun 21, 2011 9:58 pm

hardwarebob wrote:There is already one java port of this game, called RealmSpeak, but I would like to still do this project, as it will allow me to learn a lot about a new area of programming for me.!

Hi again. I looked very briefly at the game and it looks like there's quite a bit of rules involved. :?

hardwarebob wrote:I was also impressed at how I could use the PIL example of importing data into the application from a simple text file, much easier than coding some xml parser!

Ya, Lua was originally developed as a configuration language I think so importing data is one of its strengths. BTW there is an XML parser module distributed along with the engine.

hardwarebob wrote:I hope to upload some of the initial code here if people are interested in checking it out, I'm sure there are some things I can learn form your experience out there!

I wouldn't mind taking a look. :) I don't consider myself a very good Lua programmer but I know fairly well how AGen works.
Ivan
Site Admin
 
Posts: 415
Joined: Thu Dec 27, 2007 9:21 pm

Re: Magic Realm (out of publish Avalon Hill game)

Postby hardwarebob » Fri Jun 24, 2011 9:14 am

looks like there's quite a bit of rules involved.


Yes, there are! I have been searching the net for a good free online issue management application to assist with this.

With this I can manage the rules required and the defects.

I ended up going with lighthouse. It allows up to 100mb of data and 1 private project.

I will probably make it public when I get further along for others to assist with testing.

I also found a good free online hosted source control app called beanstalk, which also allows a private project with 100mb of data.

It is a large project, but when broken down into sections I hope to manage it. I knew I was up for a big challenge in doing this and I hope to learn a lot from it!
hardwarebob
 
Posts: 44
Joined: Sun Jun 12, 2011 3:41 am

Re: Magic Realm (out of publish Avalon Hill game)

Postby hardwarebob » Sun Sep 11, 2011 12:23 pm

OK, after much delay I have finally hit an initial target of mine, which is randomly setting up the initial set of 20 game tiles in random places and orientations and ensuring the pathways for each tile align correctly. Each tile also needs to be placed near at least two other tile edges. Below are a couple of screen shots for this, one an overview and one zoomed in.

My next challenge will be to perform some path finding between the clearings on each tile (these are numbered from 1 to 6, see zoomed in screen shot). There is one more setup rule which I need to implement, which is to ensure that certain tile clearings can find a path back to the starting tile (the 'borderland').

I am not exactly sure how I will implement this path finding yet, but I imagine it will be something to do with storing the relationships between each of them in an array and using this. If anyone is reading this and has some advice, I am happy to receive it!

I have also created some 'hex picking' code so that we know when the mouse cursor is over a particular location on the grid.

I will also be making another post about a bug I have with the z-ordering of the sprites. I have certain sprites behind other sprites and the one I want on top is not always appearing as the top most sprite.

If anyone wants to see the code for the creation of the hex grid I have used, I will gladly post about this. It took quite a bit of research for me to get this one correct and I have multiple sources to credit for getting it all working!

Image

Image
hardwarebob
 
Posts: 44
Joined: Sun Jun 12, 2011 3:41 am

Re: Magic Realm (out of publish Avalon Hill game)

Postby Ivan » Sun Sep 11, 2011 2:03 pm

Hey, looks pretty good! :)

hardwarebob wrote:My next challenge will be to perform some path finding between the clearings on each tile (these are numbered from 1 to 6, see zoomed in screen shot). There is one more setup rule which I need to implement, which is to ensure that certain tile clearings can find a path back to the starting tile (the 'borderland').

The engine comes with a pathfinding extension called MicroPather:
http://2dengine.com/doc_1_3/gs_pathfinding.html
Each hex tile from your map could be represented as a 'node' in MicroPather.
Your game will only need to tell MicroPather which tiles are connected (through "AdjacentCost").
After that, you can find the shortest route between any 2 tiles using "Solve".

hardwarebob wrote:If anyone wants to see the code for the creation of the hex grid I have used, I will gladly post about this. It took quite a bit of research for me to get this one correct and I have multiple sources to credit for getting it all working!

Sure, I wouldn't mind taking a look.
Ivan
Site Admin
 
Posts: 415
Joined: Thu Dec 27, 2007 9:21 pm

Re: Magic Realm (out of publish Avalon Hill game)

Postby hardwarebob » Mon Sep 12, 2011 11:51 am

The engine comes with a pathfinding extension called MicroPather:
http://2dengine.com/doc_1_3/gs_pathfinding.html
Each hex tile from your map could be represented as a 'node' in MicroPather.
Your game will only need to tell MicroPather which tiles are connected (through "AdjacentCost").
After that, you can find the shortest route between any 2 tiles using "Solve".


Thanks for the advice Ivan, but I am unsure of how it would work with what I require.

The paths in the game are not just based on tile to tile pathways. If you look closely at each tile, there are a 6 clearings, numbered from 1 to 6, each clearing is connected by a path and these paths connect to paths on other tiles. Not all pathways connect to others, so I need a way to track movement between these clearings within the tiles.

An idea I am working on at the moment is to use a 2d array to represent the clearings on each tile and the connecting clearings, then use some recursive function calls to find the paths. Not too sure if it will work yet, still going through the idea and seeing if it would work.

The array is a 6x6, one for each possible combination of connections, the y coordinates are each tile from 1 to 6 and the x is each tile that it may connect with.

-- 0 not connected
-- 1 connected
-- 2 hidden connection (these are a special kind of path)
Code: Select all
{  { 0, 0, 0, 0, 0, 1 },
   { 0, 0, 1, 0, 2, 0},
   { 0, 1, 0, 0, 1, 2},
   { 0, 0, 0, 0, 0, 1},
   { 0, 2, 1, 0, 0, 0},
   { 1, 0, 2, 1, 0, 0} }
hardwarebob
 
Posts: 44
Joined: Sun Jun 12, 2011 3:41 am

Re: Magic Realm (out of publish Avalon Hill game)

Postby Ivan » Mon Sep 12, 2011 1:01 pm

hardwarebob wrote:The paths in the game are not just based on tile to tile pathways. If you look closely at each tile, there are a 6 clearings, numbered from 1 to 6, each clearing is connected by a path and these paths connect to paths on other tiles. Not all pathways connect to others, so I need a way to track movement between these clearings within the tiles.

I see what you mean. I assume the units in the game are moved from one clearing to another. In that case each node in MicroPather could be a clearing instead of a tile.

hardwarebob wrote:An idea I am working on at the moment is to use a 2d array to represent the clearings on each tile and the connecting clearings, then use some recursive function calls to find the paths. Not too sure if it will work yet, still going through the idea and seeing if it would work.

The array is a 6x6, one for each possible combination of connections, the y coordinates are each tile from 1 to 6 and the x is each tile that it may connect with.

Is the map always the same for the game or do you plan on generating it from different tile configurations?
I don't know if a 2D array would be the most simple solution in this case. Another approach might be to put all of the clearings into a single list. Each clearing would have its own x, y position (and a reference to its parent tile if necessary). After generating the list, you'd have to somehow assign the transitions between clearings (this would be the tricky part). From that point, MicroPather could easily find the path between any 2 clearings.
I'm not sure what the game's rules are but in MicroPather you could set up different 'movement costs' for 'hidden' paths and 'non-hidden' paths.
Ivan
Site Admin
 
Posts: 415
Joined: Thu Dec 27, 2007 9:21 pm

Re: Magic Realm (out of publish Avalon Hill game)

Postby hardwarebob » Sat May 05, 2012 2:45 am

Hi there guys,

I must apologise for my absenteeism since late last year.

Things had picked up at work quite a bit, along with a host of other things going on that took my attention away from this project of mine.

I have gotten married and now have a son! So things are still a bit hectic.

Anyway, I would like to give you an update on my Lua intentions from here.

Due to lack of time to be able to commit to this, I will not be progressing with the Magic Realm game.

As already intended, I will make available my random tile generation code for critique and use for anyone else.

I still want to create a game with Lua, but know it needs to be something simpler than the complex Magic Realm rules!

I would like to now create an 'Archon II - Adpet' clone, an old C64 game for which I don't think anyone has done. So when I get started on this, I will create a new topic for it.

Looking forward to working with Lua again, let's hope I can progress it a little further, it may take some time, but I will enjoy the journey and the skills I will learn.
hardwarebob
 
Posts: 44
Joined: Sun Jun 12, 2011 3:41 am

Re: Magic Realm (out of publish Avalon Hill game)

Postby Ivan » Sat May 05, 2012 1:09 pm

Hi again and congratulations! :)
Too bad that you've decided to abandon the project - it looked promising.
I looked up Archon II briefly and it looks pretty cool.
Should be a fun project to code, especially in Lua.
Looking forward to any demos or screens that you come up with. :)
Ivan
Site Admin
 
Posts: 415
Joined: Thu Dec 27, 2007 9:21 pm

Re: Magic Realm (out of publish Avalon Hill game)

Postby hardwarebob » Sun May 06, 2012 7:55 am

Hi Ivan,

Thanks for the congrats.

Yes, I think that I will learn plenty from coding Archon and I may even be able to go back to Magic Realm after the skills I would have picked up and run with it once again.

I think it should be quicker to come up with a mock up demo with Archon, as there is really only two types of screens for the game, the main playing area, and the battle grounds.
hardwarebob
 
Posts: 44
Joined: Sun Jun 12, 2011 3:41 am


Return to Showcase

Who is online

Users browsing this forum: No registered users and 0 guests

cron