oh right. those are used in the function call, too. well… x and y are your ships coordinates, and bgmap is the number of the bgmap your level maze is in.
So I have taken up this task again and am working on compiling a library. I have some suggestions I’d like to discuss with you guys.
1) I think we should rename the library for a unified release to prevent any confusion with the hundred billion and one versions of libgccvb floating around. RunnerPack named libgccvb the “Seiryu” library in the intro text, so I think it’s a good idea to just name the library “Seiryu”.
2) I also think that it’d be a good idea to write short documentations of all the functions.
3) Let’s include a standard font which is automatically loaded to the end of Char Memory when the library is included. That way new users can use vbPrint right away.
4) About the #ifndef FUNCTIONNAME DogP suggested… I am not sure if I did it right, can anyone check the attached files?
Attached are two files which show a proposed format for the library. Comments please, gentlemen. 🙂
I assume you mean CharSeg1, not BGMap 1? You take the Chars from Char Memory (CharSeg0 – CharSeg3), not from BGMap Memory. In your demo, the tile for walls is in CharSeg1, position 0, so you access it with 512+0 (or just 512), that’s correct.
Here’s a tip: Red Dragon has very nice debug functions, and one of them allows you to view the content of the Char Memory, BGMap Memory etc. So open your demo in Red Dragon, pause with ESC, and select Debug > View > Chars to view Char Memory for example.
DogP’s code shows a function, int bgmap, int x and int y are the arguments taken by the function, as demonstrated in the last line of his code. They don’t need to be initialized (aka set to anything).
I think you’re now at the first really difficult point to overcome, you’ll need some more C (or general) programming knowledge to proceed, so I’d suggest you take your time to read through some beginner’s tutorials. If you can get the collision detection set up mostly on your own, then nothing else will be able to stop you from finishing the game. 🙂
One more note: You can move vbDisplayShow(); (line 95 of your code) out of the loop to the beginning of your main loop (but after the initialization of the variables of course). All it does is setting the brightness registers so it only needs to be called once. And since you are setting the brightness registers manually in lines 51 to 53, you don’t need vbDisplayShow() at all.
Oh, and here’s an advanced tip you might want to use later: Instead of painting a level BGMap in VIDE, and have a seperate array for collision detection, you can also generate the BGMap on the fly from the collision detection array. This would work by going through the array in a loop and writing directly to the BGMap Memory where there is a “1” (ir whatever value you want to be a wall). Here’s the code you need for that:
BGMM[(0x1000 * BGMap) + Offset] = Value;
Where “BGMap” is the BGMap to write to (0 – 13), Offset is the Char in the BGMap (0 – 512? not sure right now), and Value is the address of the Char in Char Memory (512 for your wall).
But as I said, don’t bother with this until you fully understand how Chars, BGMaps etc work.
VirtualChris schrieb:
How do i turn a vep file into an h file? Maybe that’s the problem I’m having, i did it wrong.
You don’t convert the whole VEP file, this is just a “container” file for your project. In VIDE, you create CharSets or BGMaps, and then export them individually using “Advanced” > “Functions” > “Export to *h” (A VIDE plugin by DanB which you need to install seperately, by just copying it into the “PLUGINS” folder of VIDE. Download here). Place the *.h file in your project directory and include it in the code using the “include ‘file.h'” command. The CharSeg or BGMap can then be referenced by the name you gave it in VIDE (In my example it was “FONT”). Also make sure that, if you use BGMaps you created in VIDE, the CharSet is in the correct CharSeg (As specified when using the “export to *.h” plugin).
RunnerPack schrieb:
I think we really need to work on that unified library… I’ll try to at least post what I used on my compo entry. Most things work in it and I know vbTextOut does (I used it for debugging).
Yes, we really need to get back to that topic. I started compiling one, based on the one from the vbJAEngine and my custom lib I wrote for Blox 2. I will probably work on that some more now that VUE Snake is out. Regarding the current topic, I also wrote a custom text out function, which can print from left to right or right to left, horizontally and vertically and takes the Offset of the font in RAM as input, so more than one font can be used.
-
This reply was modified 17 years, 4 months ago by
KR155E.
Use vbTextOut(), it’s a bit easier. Copy your font to character segment 3 like this for example:
copymem((void*)CharSeg3, (void*)FONT, 8192);
Here’s an example call of vbTextOut(), printing the string “TEST” to BGMap 0, starting at the tile in position x=1, y=2 (from the top left):
vbTextOut(0, 1, 2, “TEST”)
The BGMap shoud then look like this (“0” meaning an empty tile):
000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000
0TEST0000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000
[…]
000000000000000000000000000000000000000000000000
Nice! But you don’t need to use objects to have text on the screen, that’s way to complicated. Create an ASCII conform font set in vide, export to font.h, include font.h in your source (‘include “font.h”;’, as with libgccvb), and either use a BGMap with text created in VIDE (as shown in the attached image), or, much better, use the vbPrint() or vbTextOut() functions, which dynamically alter BGMaps to place Chars from your font set. Both can be found in “misc.h” of libgccvb.
Attachments:
Yep, that looks much better. Now you only got a typo somewhere around line 117. See if you can find it or post those lines here, lines 116 – 118.
Huh? Don’t know what that means. But you should try a different approach and try to compile my Programming Introductory Demo. It is meant specially for beginners, and is very well commented and verified to compile fine in the second release of gccVB (gccVB CVS 06-20-05), probably the first one will work as well.
Probably, but that would still not be ideal, because you could just upload any picture. Validating each collection would probably be a step too far, so I think it’s OK now.
Some more information would be useful. Which gccVB version are you using? Looks like the very first release? This error means, that a function (aka macro) “OBJ_YSET” is called in the code, which does not exist. As it seems, the macro in the libgccvb library in that release is still named “OBJ_SET_Y”, which was later renamed tp “OBJ_YSET” as it is called in the sample code. So just change that line in the source and see if it works then.
BTW, could you attach images to forum posts? Uploading them to our server is important for future reference. If you just link and then someday delete the image from your server, the thread will be impossible to follow. It’s also easier than uloading somewhere else. 😉
Yes, it’s there. Not sure if all games have it and where, though. You can press “W” in Reality Boy to simulate low batteries to see the indicator.
wow, this looks fantastic! can’t wait to see the whole system! 🙂
no, currently there’s no loader version for mac. if you know someone who has experience coding for macs, maybe we could port the loader, though?
EDIT: people say that the loader runs on macs when using boot camp. 🙂
-
This reply was modified 17 years, 4 months ago by
KR155E.
Right, just for fun, not a real competition. And, yeah, “from scratch” does not have to mean that we can’t recycle old code, it just means that we start working on the game on that day and not pick up an old project or something.
I am pretty sure now that I want to make a Snake game, I mean the game logic itself should be very easy to write, and I could spend the rest of the time on the graphics, maybe different modes and settings, highscore lists etc. 😉
The idea of using the same set of graphics sounds pretty cool, but I guess it would be limiting and it would be better to create graphics specially for the type of game one makes? For the GIAD project, existing graphics could be used though, to save time?
BTW, I have found your VB Art Repository thread again yesterday, and I can’t believe I totally forgot about that. I put that very high on my ToDo list for next week. 🙂
Awesome, that looks perfect! I will get into it next week. Thanks Pat! 🙂
You could do something similar to Insmouse, but with total freedom of movement, with a Wolfenstein 3D like Ray Caster, this should be absolutely doable on the VB, when properly optimized. 🙂
Yup, that’s about what I want to do. Attached is a mockup of the game I was thinking of: 3D Blockout! I assume that, once a World is Affine transformed, I can change it in any way I want without losing the transformation?
I looked at David’s demos but couldn’t get the right transformation working.
Attachments:
Cool! I am looking forward to what you can find out.
The precaution manual is the same as the US one, btw.

