I'm used to make unusual questions.. er.
Displaying 1-16 of 16 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
Nabucodonosor

1) That's about pointers... I want to know how it works with bitmaps (and others images pointers). Can I use strange functions (byte, quad) to change it or load just some part of it? Like a GrabRegion, but with direct memory acess?

2) What's TMapLine for? Why doesn't TMapPoly work in v2k? Any way to get just one line of a image fast? (I want to get more than 100 lines of a image in different pointers)

3)Is Verge slow? I mean, I always worked with it, but I want an answer from a person that worked with others compilers (related do C)... I don't want to quit Verge, just know what I can do...

If you know some webpages with info about pointers and direct memory access, tell me...



Posted on 2001-02-20 22:48:36

andy

1) Pointers are a heavy topic, and I personally don't think they even belong in the engine at all. Also, I'm tired, so I won't get into it now. I think Praetor wrote an article on the subject, however. Look for it on the VERGE Source.

2) TMapLine renders a single line of a map onscreen. It's useable for things like the "wavy" effects you've seen in certain SNES games.

3) VC is slower than C by an enormous margin. This is to be expected, since it's a script language, and not the real deal. VERGE itself is fairly finely tuned.



'Never confuse a single defeat with a final defeat.' -F. Scott Fitzgerald

Posted on 2001-02-20 23:44:00

Devon

No pointers? But without pointers, VERGE loses so much flexibility. Without direct memory access, VERGE just slips a step back towards RPGMaker. Granted most users may not understand pointers, (I get the basic idea) but I've seen the source to some advanced VC effects that use pointers heavily. Personally, I find a chain of offset pointers within an allocated memory stack to be a much better way of handling bunches of variables than using the built-ins. It just seems neater, and it does save a little memory here and there when using fewer than 32-bits. (Plus there was that weird thing with the global variables that I _wish_ I could reproduce)

VERGE is great in its ease of use, but I really think it needs the capacity to go beyond the basic. I started using 8-bit VERGE only with the understanding that it would become more advanced, which it has to a great degree. As long as those who are inexperienced do not have to concern themselves with an advanced feature, how can its inclusion be a mistake?

-Devon



--- Square's making money. We're making art.

Posted on 2001-02-21 12:09:24

rpgking

It's inclusion is not a mistake...It's just not necessary. If you look at the vast majority of V2 games out there, you'll notice that hardly anyone uses direct memory access. Only people like Mythril who make CHR editors in VC make good use of this ;)

And I don't think the exclusion of pointers would make VC less advanced or less flexible. I'd say things like classes and structures would make the language more flexible/advanced.

-rpgking



Out of clutter, find simplicity. -Einstein

Posted on 2001-02-21 14:36:43

andy

Pointers in and of themselves are pretty handy for a few things, but not for high-level programming, (I personally use them here and there for interfaces only) and certainly not for a language like VC.

Instead of mangling an image via pointer access, you would have a bunch of functions that allow you to mangle said image. Tinting, scaling, skewing, etc... could all be done faster by this method than by VC control. If said methods are kept simple and flexible, then flexibility issues are minimal.

v2 is incapable of having hardware acceleration simply because DirectX and OpenGL (or more accurately, graphics hardware) have rules (or they outright forbit) direct access to image memory, for example. In my experience, complying with those rules is incredibly slow. (v2.6 has to copy the screen onto such an image surface at every retrace, hence it is noticably slower than its DOS counterpart)

Even more entertaining is the fact that making sure that a pointer is valid under v2 would be excruciatingly slow, so it isn't done. I think the result of that decision is pretty plain to see. ^_~

Finally, I've come to be very dissapointed in v2.6. It's far too unstable for its own good. The VC coder should be incapable of crashing the engine.

The one exception, I will admit, is dynamic arrays. Pointers do make them a cinch to implement. I'm still thinking about how to implement them the Right Way in VC.



'Never confuse a single defeat with a final defeat.' -F. Scott Fitzgerald

Posted on 2001-02-21 17:23:39

Devon

Well, thanks for explaining that. VERGE makes all that much more sense now.

Is all malloc'ed memory considered image memory? That's what it sounds like. Would it be possible to just have two malloc functions, one for image use, and one that works like the current malloc, or is DX/OGL really that picky about that?

Thanks for fixing the tile selector in Maped, too. :)

-Devon



--- Square's making money. We're making art.

Posted on 2001-02-22 17:46:38

andy

It doesn't quite work that way. DirectDraw uses the COM interface to give you a pointer to a surface object. The surface can be locked, and the image memory directly accessable, but it's an excruciatingly slow process. The blits, however, are potentially blindingly fast under accelerated graphics cards. (I've clocked my latest testbox at 350fps, against v2k DOS's 80 under the same situation)

OpenGL is another matter entirely. You give it some raw pixel data, and it returns a handle to a texture. This might sound more feasable under v2, until you realize that the process is similarly slow. It would be unrealistic to copy a billion textures over and over again every retrace. I don't think you can ever access an existing texture's pixel data at all, only destroy and reallocate.

My goal is to allow the engine to support any graphics API, so the only feasable way to do that is to abstract a high level interface over it. I've already done this too, and it works marvelously.

Most likely, images will be handled via integer handles, much like fonts are already. It might feel limited, until you realize that setrenderdest allows you to do many of the things that people usually use direct pointer mangling for. Lastly, this method allows the engine to keep things under control, making a FreeAllImages() command trivial.

Put simply, the interface would be simpler, safer, faster, but admittedly little more constrained, though still more than sufficient for the majority of tasks.



'Never confuse a single defeat with a final defeat.' -F. Scott Fitzgerald

Posted on 2001-02-22 20:33:17

Devon

Yes, I see how that works. I don't mind losing the ability to directly manipulate image data as long as VC functions can replace the various effects, although it would seem to kill the whole multiple images in one buffer pointer trick, which my battle system was going to use...

But the idea is that VC functions can still manipulate the data though, right? I mean, RotScale and such can still do their things, because they're not changing the data, just using it differently, which would mean that new built-ins could be added to replace things like perspective scaling (SNES Mode7 stuff) and the little trick to keep all the frames of an animation in one image that are done with pointers?


What I was acually getting at in my last post though was can you still use malloc to create a buffer and store just integer data in it with byte()s and word()s, or does DX/OGL automatically take that as image memory and prevent access to it? Couldn't the malloc function create non-image memory just for storing data that the graphic system will never touch?

I'm just trying to figure this out, because it sounds like my entire character/menu/combat system will be trashed by this. I do need that FPS boost, though.

-Devon



--- Square's making money. We're making art.

Posted on 2001-02-24 23:09:32

nimrand

A lot of people ask about Verge's speed. While Verge is grossly slower than a counterpart done in pure C++, most of the games made in Verge aren't very intensive anyway. If one were making a graphics engine with 16-32bit color, hundreds of sprites, special effects, and real-time 3D, you'd want to get every drop out of the processor you can. But, the 8bit graphics with a limited number of predrawn maps and sprites, Verge's lack of speed becomes almost a mute point. I have seen some games with Battle Systems with so much scripting that the game slows down significantly, but even then only when there are a lot of characters/monsters participating in the battle. Also, keep in mind that the extra time Verge takes is attributed to the time it takes to interpret the scripts, not to actually do what the scripts tell it. Therefore, doing a single graphics operation by calling one function would only take as long as C++ would take to do it plus the time it takes to interpret one line of code, which isn't much. The big slowdown in Verge when compared to C++ is when lots of calculation is involved which required Verge to interpret many statements.



Posted on 2001-02-25 14:04:52

Devon

Maybe the average VERGE game is as you describe, but there are more advanced projects out there that need major speed out of the graphics. My own project drags the engine down to 6FPS rutinely on basically pure graphics. I'm doing 640x480x65535 and blitting multiple large translucent images and WrapBlit()s, and my battle system is entirely VC graphics, no tiles or entities. VERGE as it is is fine for people who just want to tinker with game design, but if you are really serious about it, sooner or later you'll want to present something better than static tiles and some sprites. For instance I have a nifty flowing water effect that murders the framerate. I also want to do nice paralax-scrolling cutscenes that will require multiple layers and transparencies at a reasonable framerate.

Also, if you are just talking 8-bit DOS VERGE, keep in mind that V2.6 currently runs at about one forth the speed graphically.

-Devon



--- Square's making money. We're making art.

Posted on 2001-02-25 18:55:32

Devon

I forgot what the original post was about. I thought you meant something else.

Sorry.

-Devon



--- Square's making money. We're making art.

Posted on 2001-02-25 18:59:25

nimrand

Data structures and classes would be a great addition to Verge. Somehow I don't see it happening anytime soon, however.



Posted on 2001-02-25 22:58:02

andy

It'll still be very possible to cram many images into one larger image, since setcliprect will remain. You would simply clip the image, then blit it. The section you want to see will be the only one visible. Moreover, you no longer have to cram all of your images in a vertical strip.

The main problem is that the engine has no idea what the images are comprised of. In a pure software driver, they could well be simple char arrays. A directdraw renderer would use surfaces, which can exist in the memory on your video card, instead of system RAM. An OpenGL driver could store them as textures to be attached to polygons. The engine simply holds on to them, and hands them over to the graphics system when they're to be manipulated.



'Never confuse a single defeat with a final defeat.' -F. Scott Fitzgerald

Posted on 2001-02-26 00:55:46

Devon

Okay, so if I'm following this correctly, that means that the total size of all concurrent blits, entities and fonts, plus all tiles in the current VSP cannot exceed the total amount of RAM on the video card, minus that used for the frame buffers?

I would guess that the VSP would have to be loaded as a whole, or could individual tiles be swapped to video memory as needed?

(Just thinking in terms of old 8MB cards that would probably come up short on memory with large highres VSPs, although I don't know anyone with less than 16MB.)


True about the clipping function. Originally my battle system was going to use that, but when the framerate became a problem, I figured that using the pointer trick resulted in faster blits and less VC processing, and I forgot about using SetClipRect.

-Devon



--- Square's making money. We're making art.

Posted on 2001-02-27 10:32:51

nimrand

(nt)



Posted on 2001-02-27 15:17:36

andy

DirectX will put images in system (non-video card) memory if it has to, but it'll use video RAM whenever possible.

Simply put, neither you, or even I have to worry about that. ^_~



'Never confuse a single defeat with a final defeat.' -F. Scott Fitzgerald

Posted on 2001-02-28 21:02:32


Displaying 1-16 of 16 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.