Moar paper dollage
Displaying 1-20 of 20 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
Zip

I've just done some experimenting and expanded HookEntityRender() in the docs a little, I think this rather hightlights how awkward the current way of paper doll-ing is. As vec has just been wonderful and added a handle to the vsp, I thought I'd request one to the chr graphics again. Oh, and an EntitySplat() function to go with EntitySpawn().

It would be quite nice to have the option of creating an entity at runtime from data, rather than requiring a chr, or even just access to some of the things set up by the mak. At the moment there's rather a lot of stuff:

chr_version 5 | in annabelle.png | out annabelle.chr
frame_w 32 | frame_h 32
hotspot_x 8 | hotspot_y 16 | hotspot_w 16 | hotspot_h 16
frames_per_row 5 | frame_rows 6
d_idle 0 | u_idle 5 | l_idle 10 | r_idle 15
d_walk F0W10F1W10F2W10F0W10F3W10F4W10
u_walk F5W10F6W10F7W10F5W10F8W10F9W10
l_walk F10W10F11W10F12W10F10W10F13W10F14W10
r_walk F15W10F16W10F17W10F15W10F18W10F19W10


I'd say the following functions might work:
int CreateEntity(int map_x, int map_y, string image, int frame_w, int frame_h)
// Auto detect frames_per_row and frame_rows set chr_version to 5
// Set default values for hotspot, idle and animations

void EntitySetWalk(int entity, int direction, string movecode)

Hotspot already has entity.variables, add four for the idle animations. So then, you could make an entity at runtime like:
int new_ent = CreateEntity(76, 64, "annabelle.png", 32, 32);

entity.hotx[new_ent] = 8;
entity.hoty[new_ent] = 16;
entity.hotw[new_ent] = 16;
entity.hoth[new_ent] = 16;
entity.idleu[new_ent] = 5;
entity.idled[new_ent] = 0;
entity.idlel[new_ent] = 10;
entity.idler[new_ent] = 15;
EntitySetWalk(new_ent, 1, "F5W10F6W10F7W10F5W10F8W10F9W10");
EntitySetWalk(new_ent, 2, "F0W10F1W10F2W10F0W10F3W10F4W10");
EntitySetWalk(new_ent, 3, "F10W10F11W10F12W10F10W10F13W10F14W10");
EntitySetWalk(new_ent, 4, "F15W10F16W10F17W10F15W10F18W10F19W10");

Might seem a little long winded, but being able do this at runtime would save ALL KINDS of pain elsewhere.


I'm looking forward to being able to use the renderstring properly. What I need to do at the moment it something like:

FloorLayers-R1-BackLayers-R2-Entities-FrontLayers-R3

With R1 as the grid, and any square highlights; R2 dead entites; and R3 overlays and stuff.
I tried emulating the R2 layer with HookEntityRender(), but ran into problems over y-sorting: creating a blank entity at 0,0 would solve this, but just adds to an already ugly hack.

Enough random rambling,

Zip

[Edit: Dorgot map x,y values for spawn]

Posted on 2004-07-23 19:00:39 (last edited on 2004-07-23 19:15:44)

mcgrue

I, for one, am all for having every element of metadata in all aspects of v3 being accessible at runtime via vc.

Posted on 2004-07-23 23:22:07

Gayo

Being able to set the walk animation at runtime would also allow people to have separate walk/run animations, which is a bit ambitious for the average VERGE chrmaker, but would be rock out awesome nonetheless.

Posted on 2004-07-26 07:00:43

mcgrue

I had not considered that. Yes, it would be awesome... and easy enough to implement.

Posted on 2004-07-26 17:58:28

Interference22

Hey Zip, that MAK file info is straight out of my Annabelle CHR data for P7! Shrewd bit of marketing there! Ehehe.

Posted on 2004-07-27 01:12:43

blues_zodiakos

I'm actually pretty interested in paperdoll (I hate that name) techniques for a game I'm considering making(think World of Darkness).

Maybe it would be useful for someone to simply make their own entity rendering system on top of the current one.* A unified library of customizable entity handling would be doable with verge3 as is, and yet would not require any changing of the current code (for newbie reasons). Wouldn't this be the best of all worlds, considering the fact that even if the verge team adds features x, y and z in, it would be much easier to customize if someone had a verge script to work with instead?

*I'm writing this at 3 in the morning. Not edited for clarity or sanity.

Posted on 2004-07-27 09:09:11

vecna

This is all theoretically cool and, theoretically, not that hard to do, but there's one big catch right now, which is that CHRs are cached. Most real-world maps typically have more entities than they do unique CHRs, and I didn't like the way maped2/v2 had that 'chr list' and then you plugged in the chr index for the entity. So in v3 we just made it so you listed the CHR for each entity, and had the engine do a caching system so that, in that HOV entry where every entity was Darin, only one CHR object is ever loaded. So... as things are setup, any modification to one CHR's stats would modify every CHR that uses the same file.

I'll have to think about any possible compromise solutions.

Posted on 2004-07-27 17:36:35

Zip

Interf. - ehe, evil plan continues.

Blue - It's better to leave as much of the leg work in the hands of directx. Much of this post is conceren with the attributes of entitys, rather than the actual rendering. Paper doll should NOT be re-drawing the sprite every render, it wants to be done just when you equip the different colour trousers.

vec - Glad you're into it. I hadn't realised the entities were handled like that. Out of curiosity, how much performance would be lost if each one did have their own information? I can imagine it being a problem on big maps, but I *need* to kill that horrible every-entity-looks-the-same thing. Could you make it so a runtime load (like the example above) ALWAYS created a new chr? Keep the cache for .chr loaded entities? Then you probably would have to leave some of those variables read only, and set up a few more access functions, SetEntityHotspot() etc.

Zip

Posted on 2004-07-27 18:44:20

Gayo

I dunno -- since many of my things rely entirely on runtime loads, and since I have no interest in paperdolling, that would screw me over. I don't think you can really say that runtime-generated chrs are any more likely to need individual chrs. What I think you might need to do is have the system generate a unique chr for every entity, or something similarly unpleasant.

Posted on 2004-07-27 22:21:29

blues_zodiakos

What I was trying to hint at more in my post (and it seems unsuccessful) is that someone (maybe me) needs to create a custom entity handling system. The sprites wouldn't need to be "remade" any more than they already do because everything is redrawn every frame anyway everytime you ShowPage. The paper doll system would basically create a new CHR sheet in a NewImage everytime a part of the character is changed, then blit frames from that image. The entities on the map themselves would just be null placeholders, and HookEntityRender would do all the actual work of rendering the enities. Or you could just gut the entities themselves and rely on your own variables to take care of them. Depending on the game, there might not even be any noticable speed difference, because there would be virtually no real calculation involved. Yes, it sounds involved... but not really that difficult. And the code would be reusable in pretty much anybody's game.

Posted on 2004-07-28 01:32:14

Interference22

Vecna: would you believe I actually suspected that CHRs would be handled like that? Still, is that so much of a problem if paperdolling were really only used for partymembers?

A possible solution would be to have a flag you could set that says whether an entity uses a unique CHR or not, so we save memory when we can and use more of it for funky paperdolling when we need to.

Posted on 2004-07-28 02:43:09

Zip

Gayo: Done properly, I really can't see the bloat being that excessive, but for people with a lot of entities on a map at once, perhaps you are right. I have yet to see ANY performance problems in verge from numbers of bitmaps loaded at once - system memory of medern computers is just too large. Each chr is still only gonna be blitting a simgle frame each Render() after all. Anyway, how many identical entities do you load runtime? Unless your maps are REALLY boring, I can't see you making much saving.

Blue: Fair enough, but I'm still sure that low level stuff like entity handling should be handled dev side.

Interf: Flag it baby. Seems fair to me.

Posted on 2004-07-28 03:05:04

Gayo

That's true, Zip, but if you don't consider it a meaningful excess there's no reason to have caching on any chrs. The way you suggested is like not allowing dogs into your store unless they're wearing hats.

Posted on 2004-07-28 05:57:34

Interference22

Quote:Originally posted by Gayo

That's true, Zip, but if you don't consider it a meaningful excess there's no reason to have caching on any chrs. The way you suggested is like not allowing dogs into your store unless they're wearing hats.


Gayo, WTF? What have dogs wearing hats got to do with ANYTHING?

Posted on 2004-07-29 00:25:28

Gayo

You take 9999 analogy damage.

Posted on 2004-07-29 00:53:16

Interference22

Quote:Originally posted by Gayo

You take 9999 analogy damage.


Damn, only one hitpoint left! Where did I stick my Advanced Healing Salve +72 Against Dogs?

Posted on 2004-07-29 23:25:46

Gayo

I'll tell you where to stick your Advanced Healing Salve +72 Against Dogs.

Posted on 2004-07-29 23:32:04

Interference22

Quote:Originally posted by Gayo

I'll tell you where to stick your Advanced Healing Salve +72 Against Dogs.


In my mouth? Please tell me it's in my mouth.

Posted on 2004-07-30 00:04:10

mcgrue

Well, it's sorta like a mouth...

Posted on 2004-07-30 00:06:17

Toen

Quote:Originally posted by mcgrue

Well, it's sorta like a mouth...
It's like the mouth of someone who's sucking on a piece of lemon.

Posted on 2004-07-30 00:33:29


Displaying 1-20 of 20 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.