Need help with game engine

BlitzPlus Forums/BlitzPlus Programming/Need help with game engine

schilcote(Posted 2009) [#1]
When I was aboout six, I coded up a simple game engine which uses ASCII and ANSI graphics to allow playing of a game which would be coded in an extended version of blitz basic. Recently, I saw my project page on sourceforge, and decided to continue work on it. Does anybody want to help me? I need a little help finishing and polishing the engine, and I need a lot of help making a game for it. Any takers?


Pineapple(Posted 2009) [#2]
I'd consider it, but I'd prefer to see what you have thus far, and more details of what your goal is before I get involved.


Gladclef - Ben B(Posted 2009) [#3]
Um, yeah, I have no leads to your code and your homepage link leads nowhere as well. Give us more contact info.


schilcote(Posted 2009) [#4]
Okay, I just wanted to make sure pepole were interested before I wasted my precious time uploading the code to HotLinkFiles.

[url=http://www.hotlinkfiles.com/files/2244045_uyisj/XYEngine.zip]XYEngine.zip[/url]

My goal is to create a simple yet powerfull framework for game makers who are new to B+. With this as a base, they simply need to code Map.bb and compile.


Sauer(Posted 2009) [#5]
I compiled, it said I ran into a wall once, then apparently the wall was nonexistent... frankly I'm rather confused as to what its supposed to do.

I think it would be wise to either provide better documentation or a sample game.

I was doing a ASCII adventure game in December, and I believe it's similar to what you are trying to accomplish. If you have any questions I can probably help.


schilcote(Posted 2009) [#6]
You asked for code, you didn't specify that it had to work. :) This code was originally made for B2D, so there's going to be some problems to get it working in a B+ enviroment. I think I'll have to do something special with ANSI escape codes to get the graphics right. I'll write some docs too. As I said in the OP, I need somebody to help me with the sample game. I have a weekend coming up, so I should be able to work on it some more. A note though, this might not even be possible with the limitations of B+. Not being able to display ANSI characters in graphics mode with Text is a large setback.


Sauer(Posted 2009) [#7]
Well before your engine can be used to make a sample game, it has to work properly :)

And about the ANSI characters, you should be able to make a game fine with the 200+ ASCII characters. If you really need the ANSI graphics, AFTER you get it working with ASCII you can find a creative method to get those characters. That is only if you decide you absolutely need them.


schilcote(Posted 2009) [#8]
I'm having some trouble with Types (I've never used them before) but I should have a working engine in a little while. Here's the code that's causing the problem.



It says it expects an EndIf right before the $ in Name$ in case 0. I can't see why.

EDIT: Oh wait, I see now. Debuglog=? Why did I type that?

Okay, I fixed that, but it didn's solve the problem.


Sauer(Posted 2009) [#9]
NPC.name$ = New NPC


I think you're going to have issues with this line. You can't make string values (like a name like "Fred" or "Gorgoth") to become variables inside the program.


schilcote(Posted 2009) [#10]
Yeah, I found that out with a little research. I think I've got it working. I'll scribble up some documentation and let you look at it.

EDIT: Unfortunately, my trial copy of word has expired...

EDIT:
Okay, here it is. You might have to comment out the NPC example in Map.bb, it doesn't seem to like my variables.

http://www.hotlinkfiles.com/files/2252462_cpdix/XYEngine_061913.zip


Sauer(Posted 2009) [#11]
Doesn't work at all. Got an error, fixed it, tried again, repeat.

May I suggest doing a total tear down and rebuild? The second time around always produces better results... also, with such a small engine perhaps it would be wise to not use multiple sources. It's more coherent for a smaller project and will be easier for others to understand.

When I get back to my Win98 machine with my engine source on it, I'll comment it and post it up for you to use as a reference. I'll make a sample game too.

Good luck!


schilcote(Posted 2009) [#12]
I think I'll keep going with my orignal code, the core of it works well.

Also, the multiple source thing is organised like it is for a reason: I have 4 source files, two of engine code, two of game code. The XY.bb file contains the raw essence of the engine, the code I wrote way-back-when. Then, there's Includes.bb, which contains functions and things that shouldn't be hidden in XY.bb. Then, you have Map.bb, which contains map objects, and Draw.bb, which contains graphics objects.

My current problem is, every time I try to write a NPC engine, it fails epicly. It should work this time (it's a good bit less ambitious than the NPC engine I had before) but, when I try to compile with a little talking smiley in the map code, it complains of incompatible variable types.

I should set up an SVN or something.
Here's the code:
http://www.mediafire.com/file/ymlmmoukgzy/XY Engine.zip


Sauer(Posted 2009) [#13]
I can't get it to work.

Does this even run on your machine? I'm getting variable mismatches, non Type errors, among others.


schilcote(Posted 2009) [#14]
No, it dosn't. I've tried debugging it, but I can't seem to find the problem. I'm new to types, and the variables it says are mismatching are both integers. I can't find the problem. The code that is causing the problem is in the "NPC section" of includes.bb and the "NPC example" of map.bb. I'll take a fresh look at the code later, maybe I'll have an insight.


Sauer(Posted 2009) [#15]
Ohhh ok I thought it was finished and working or something, which confused me because it wasn't.

And I tried looking at it, but it has so many issues I think your best bet is a complete tear down and rebuild. The four source codes do not integrate well together. Rather than build the game between four sources, a better strategy is to start with one. Then, when a certain function of collection of functions (like moving, collisions, npc, whatever) work perfectly the way you want them to, move them to an include file and forget about them. But working between four sources that are all implemented at different times is confusing and extremely difficult to debug.

From what I could tell though I believe a lot of your problems are resulting from confusion between the NPC type name and the NPCs instance name. Also, your NPC code needs to be wrapped in a For-Each-Next loop so that it cycles through all the NPCs instances.