Last Good Quote: Son's are the seasoning on our lives. - Someone on Facebook

Monday, July 16

PHP Code: Get Root Folder

The following snippet will return the root path of a file. This is usfull when running an include within an included file. Sometimes you don't know what directory it will be excuted from

ULR: http://snippets.dzone.com/posts/show/4210

function
getCurrentDirectory() {
 $path = dirname($_SERVER['PHP_SELF']);
$position = strrpos($path,'/') + 1;
return substr($path,$position);
}

Link: Display Images in Folder

Displays all the images in a folder

From Snippets:

http://snippets.dzone.com/posts/show/4259

Great Quote

Found this great quote:

The statistics on sanity are that one out of every four Americans is suffering from some form of mental illness. Think of your three best friends. If they're okay, then it's you.
-Rita Mae Brown

I don't have any friends I would say are crazy just different. Does that make me the crazy one?


New Game: Blade Warriors

Haven't posted in a while, I figured I'd let all seven of my readers know what was going on.

I built a new game called Blade Warriors. It came out of some of the previous blog entries.

It's got a couple of cool things going on. There is an isometric grid being displayed. This grid is built with javascript and css. I used a familiar layering technique.
  • Build the floor first
  • Each tile is it's own div with a unique id (IE: tile_x_y)
  • Lots of complicated mathmatics to get the exact positioning right, I just kinda played with the numbers till they all fell into place.
  • Once the floor is built I then place objects on top of the tiles
  • Once the objects are there I placed the unit images on top
The game runs well right now, I'm working on getting some users to come to the site but it seems when ever I make a post I get a small increase in users and then it drops back to around 50 people a day.

I'm going to go back and examine my analytics log and see what's happening there.

Thursday, February 22

War Game Update

Been out of it a bit with a root canal and a bit of a cold. But I'm back now.

I added the ability for the agents to move in a direct line, this will come in handy when determining line of sight. I think that completes the initial requirements lists. So here is the next list of todo's for this little project:

1. Restrict movement range
2. Restrict firing range.
3. Allow user to turn on and off range display.
4. Display units as images rather then circles. *grin*
5. Scorekeeping needs to be added for kills.

That's it for now.

Monday, February 12

ASP and multiple values

A good friend of mine asked me a question about ASP programming. I remember spending quite a while figuring this out the first time I ran into it so I figured I'd share with you.

Question: I've got multiple text input fields on a form. All the input fields have the same name. How do I recover the values in the fields once the form is posted.

Answer:

When this happens all the variables go into an array on the response object. You can access them by selecting thier index value. Like the following
PetsName(0)
PetsName(1)
PetsName(2)

You could also loop the the array and display each value.

for each pName in PetsName
response.write(pName)
next

Thanks Wes for the blog posting.

Friday, February 9

War Game Update

So I did a little coding. It actually didn't take me near as long as my estimates came out to be. I've put the new time at the bottom and revised the rest of my estimates. Enough about the mundane though. Here's a few things I learned/decieded.

Instead of creating an agent object and creating an array of those. I used a collection of arrays. I know, I know half of you are cringing at hearing that. Now normally I'm all for OOP goodness but as I implemented it that way. I found that there was a huge lag when it came time to paint the map with the agents on it.

I'm clearing the map, then painting all the agents on the map. Of course this means I have to loop through the array of agents, then calling the property object. You don't realize the overhead until the screen starts to lag.

Lesson Learned. I went back and created a number of array's that hold agent information. Something like the following...

Dim agentID(0) As Integer
Dim agentOwnerID(0) As Integer
Dim agentX(0) As Integer
Dim agentY(0) As Integer
Dim agentDestX(0) As Integer
Dim agentDestY(0) As Integer
Dim agentWait(0) As Integer
Dim agentAttWait(0) As Integer
Dim agentIsAttacking(0) As Integer
Dim agentSpeed(0) As Integer

Interesting huh...we will see how much this cost me in the long run.

I also built a quick push function which will put an element on the end of the array. It's rather simple and there probably is a much better way to do this.

Function pushInt(ByRef arr() As Integer, ByVal v As Integer)

Dim tmp(arr.Length + 1) As Integer
arr.CopyTo(tmp, 0)
tmp(tmp.Length - 1) = v
arr = tmp

End Function

Anyway at this point users can login, register, select thier unit, move it, and shoot an enemy unit.

Each unit will wait 10 seconds before it becomes active again.

Thursday, February 8

Programming Languages

I got to thinking what programming languages I have used and what I thought of them.

PHP
Classic VB
ASP
VB.NET
C#.NET
Java
Lisp
SQL (mySQL,T-SQL)

I've done a little with the following languages but definitely wouldn't label myself as a professional.
C++
C
Perl

Tuesday, February 6

Game Concept: War Game

I was thinking of working out a game which will mock a miniature war game table. Having said that let me list out a few requirements.

This will be done in .Net as a web enabled application.

1. Completed 02.06.07 - User will need to login and register. Authentication will take place through a web service which pings mobeamer.com.

2. Completed 02.06.07 - The playing board will be seen in a top down view.

3. A user will have an "army" list:
  • 1 - Heavy Hitter
  • 2 - Medium Hitters
  • 3 - Light Units
4. Completed 02.06.07 - A user can interact with any active unit.

5. Completed 02.06.07 - After taking action a unit will become inactive for a time period.
2 wait periods, one for moving and one for shooting

6. Completed 02.06.07 - Units can take one of the following actions:
  • Move - Move to a location within their movement range
  • Shoot - Shoot an enemy unit within their shooting range
  • Line of sight will not be taken into account yet.
7. Completed 02.06.07 - Other player's characters can be seen on the map. This will be done by pinging a web service from mobeamer.com. The web service will return all units and thier coordinates on the current map.

8. AI will be extremly simple, as an ai unit becomes active it will shoot any thing within range. If nothing is within range it will move closer to a unit.

Estimates:
1. User Login - 4 hrs
2. Top Down Map - 8 hrs
3. Army Lists - 2 hrs
4. User interact - 2 hrs
5. Inactive Unit - 2 hrs
6. Movement and Target - 8 hrs
7. Communication - 16 hrs
8. AI - 8 hrs

Estimates - Revised 02.07 :
1. User Login - 1 hrs
2. Top Down Map - 2 hrs
3. Army Lists - 4 hrs
4. User interact - 4 hrs
5. Inactive Unit - 1 hrs
6. Movement and Target - 3 hrs
7. Communication - 4 hrs
8. AI - 8 hrs

Intro - What this is all about

Hello, my name is Markus Beamer. I love programming and solution solving. I've worked in many areas of the web development arena. I've classified myself as many things over the years. DBA, Database Developer, application developer and the list goes on. However, I aspire to be a software architect.

That being said I have a side hobby which I really love, game development. I certainly don't consider myself a professional at it. But I do like to think I'm a little better then most hobby game writers.

I keep a few of my games on www.untouchablegames.com and I play with code on mobeamer.com. Check out either site and feel free to leave a comment.

I'm keeping this blog in hopes to capture all the crazy ideas that tend to sprout from my head. My most recent craze is to develope a .Net game.

Followers