You are not logged in.
Lost Password?


Register To Post



 Bottom   Previous Topic   Next Topic

#1
Showing OBJs?
Posted on: 2008/6/9 4:43
VUE(xpert)
Joined 2006/9/29
USA
267 Posts
CoderLong Time User (13 Years) PVBCC 2010 3rd
Thanks to KR155E's demo (and the suggestion of using the older gccVB) I can finally start writing software for VB! Thanks a bunch!

I've been playing around with displaying BGMaps to the screen, but I realized that in order to do any work with small sprites, objects are what I should use. My question is... where do I start? I looked through libgccvb's (the one that KR155E included with the demo) vbSetObject procedure, but I'm confused as to where to go next, can someone point me in the right direction? I know I should probably make an object world, but I'm totally lost as to where to go from there.

(Pretty soon, I'm going to want to start playing around with affine mode )
Top

#2
Re: Showing OBJs?
Posted on: 2008/6/9 7:22
PVB Elite
Joined 2003/7/25
USA
1507 Posts
PVBCC 1stCoderContributor#3 PosterHOTY09 EntryLong Time User (15 Years) App CoderPVBCC 2010 EntryPVBCC 2013 Entry
I wouldn't mess w/ using OBJs yet... BGMaps are easiest to use since you can set up a BGMap of large or small sizes, and move the entire image around by just changing a few parameters. OBJs are kinda a pain as you have to individually handle each 8x8 character, so if you have a 16x16 image in OBJs, to move it you have to individually move all 4 8x8 characters. The real advantage is that you can control many objects individually (1024 IIRC), where if you use BGMaps, you can only have 32 worlds, so it's inefficient to waste a whole world on very small objects. But if you need less than 32 different things on the screen, and the images are larger than 8x8, then I'd recommend using BGMaps.

One type of game I could see OBJs being useful would be something like Robotron. This would have a lot of small characters (8x8 or less, and more than 32 of them) all individually going their own directions. A game where it wouldn't be as useful would be something like the TMNT arcade game. This would have relatively few large characters (~64x32 and less than 32 on a screen at a time). That would be much easier to set each Turtle to it's own world, and use a world or two for the scenery, and use the rest for enemies (it'd be limited to ~25 or so enemies at a time). It's also inefficient to chunk that many OBJs together anyway, since with a max of 1024 OBJs, a 64x32 character would waste 32 (8x4) OBJs, which is just as limited as using the worlds (max of 32).

DogP
Top

#3
Re: Showing OBJs?
Posted on: 2008/6/9 11:07
PVB Elite
Joined 2003/7/26
USA
1465 Posts
PVBCC EntryCoderContributorSpecial AchievementTop10 PosterHOTY09 EntryLong Time User (15 Years) App Coder20+ Game RatingsPVBCC 2013 Entry
Have you tried the Wiki? If you have, try it again. I just finished editing it for clarity.

DogP's post notwithstanding, I think there are definite uses for OBJs in a game. A large part of what makes "gamers" (i.e. those whose cable boxes are permanently set to G4TV ) ooh and ahh over modern games is the use of particle effects.

Some VB games (Panic Bomber, for one) already feature OBJ-based particle effects and there is no reason they can't be used to great effect in homebrew, too, IMHO.

Also, as I hope my new Wiki article will show, it's really not that confusing to use OBJs. Although, for particles and most other uses, I would steer clear of the "SetObject" routine. Using an optimized loop to edit OAM entries directly is a much better idea.

Make sure and post any specific questions if you still can't get it working.
Top

#4
Re: Showing OBJs?
Posted on: 2008/6/9 11:32
Administrator
Joined 2000/1/8
Germany
2515 Posts
Highscore Top10Highscore Top ScoreCoder#1 PosterHOTY09 1stLong Time User (15 Years) App Coder90+ Game Ratings
nice article, thanks! :)
Top

#5
Re: Showing OBJs?
Posted on: 2008/6/9 11:43
PVB Elite
Joined 2003/7/26
USA
1465 Posts
PVBCC EntryCoderContributorSpecial AchievementTop10 PosterHOTY09 EntryLong Time User (15 Years) App Coder20+ Game RatingsPVBCC 2013 Entry
It's basically the same thing slightly rearranged, but you're quite welcome!
Top

#6
Re: Showing OBJs?
Posted on: 2008/6/9 14:58
VB Gamer
Joined 2007/12/26
41 Posts
Long Time User (11 Years)
One thing I was wondering is how often and how fast you can change backroung maps. Can you change a BGmap every frame?
Top

#7
Re: Showing OBJs?
Posted on: 2008/6/10 0:10
VUE(xpert)
Joined 2006/9/29
USA
267 Posts
CoderLong Time User (13 Years) PVBCC 2010 3rd
The wiki helps a lot, but I have a clarification question...

If you create an object, using the vbSetObject procedure in libggcvb, It will create and object at the nth spot in OAM. When drawing worlds, the first object world only draws the last 256 objects in OAM. Does this mean that when using vbSetObject, you should start creating objects at n = 1024, and work your way backwards? Also, does this mean that in order to get to object #1, you have to have 4 object worlds?

I can see why you'd want to use BGMaps instead of OBJs for large sprites, but I'm still curious about OBJs. I also have some questions about display refreshes later.
Top

#8
Re: Showing OBJs?
Posted on: 2008/6/10 2:10
PVB Elite
Joined 2003/7/26
USA
1465 Posts
PVBCC EntryCoderContributorSpecial AchievementTop10 PosterHOTY09 EntryLong Time User (15 Years) App Coder20+ Game RatingsPVBCC 2013 Entry
Bruno:

You can write to any part of the VIP's RAM (which includes Frame buffers, Chars, BGMaps, OBJs, Affine/H-Bias tables, and VIP Registers) any time except when it's being accessed to draw the images displayed on the screen.

Here's some code from the "vbSetWorld" function:


while (VIP_REGS[XPSTTS] & XPBSYR);
// Edit the RAM


(It should probably be in vbSetObject, too... Also, it assumes the VIP is on {VIP_REGS[XPSTTS] & 2 == 2} and if not it will be an infinite loop.)


Fwirt:

1. The VIP does not work in 256 OBJ increments unless you set the SPTx regs that way.

2. It does not start at the "last" one (1023). It starts at whatever SPT3 is set to (it can be anywhere from 0 to 1023).

3. All 1024 OBJs can be drawn in one World; just set both SPT3 and SPT2 to 1023.

4. Check the Wiki again, because I just rewrote the "drawing procedure" explanation.

Hope that helps!
Edited by RunnerPack on 2008/6/10 2:38
Top

#9
Re: Showing OBJs?
Posted on: 2008/6/10 5:35
PVB Elite
Joined 2003/7/25
USA
1507 Posts
PVBCC 1stCoderContributor#3 PosterHOTY09 EntryLong Time User (15 Years) App CoderPVBCC 2010 EntryPVBCC 2013 Entry
RunnerPack and Fwirt: Yes, there definitely are good uses for OBJs (and I was also going to mention particle effects), and I didn't mean to imply that they're useless... I was just making a suggestion that if you're just starting out, most "beginner" apps/games don't need to make use of OBJs since they're typically more complex/difficult to work with, and have fewer well documented examples of using them.

If you're wanting to use them just for the sake of learning how to use OBJs, or if you have a specific reason that you want to use OBJs, that's great... and just you bringing this up caused RunnerPack to update the Wiki with some good info... so thanks for that! I just wanted to make sure you're not making it more complex than you needed to by thinking that BGMaps could only be used for Backgrounds.

DogP
Top

#10
Re: Showing OBJs?
Posted on: 2008/6/10 13:24
VB Gamer
Joined 2007/12/26
41 Posts
Long Time User (11 Years)
Another retarded Bruno question:
Is there anyway to do HiBias on objects? And would there be any way to do hibias mode not only on the x axis but also on the y axis.
Top

 Top   Previous Topic   Next Topic


Register To Post