|
|
|
Help!
by VoroneTZ. 10/14/25 05:04
|
|
|
|
|
|
0 registered members (),
9,184
guests, and 0
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
2D questions
#403492
06/21/12 10:40
06/21/12 10:40
|
Joined: Mar 2008
Posts: 2,247 Baden Württemberg, Germany
Espér
OP
Expert
|
OP
Expert
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
|
English Version as second! Bitte auf englisch antworten  Also, ich arbeite seit längerem an meinem 2D RPG Toolset. Das mapping klappt super, ist auf Panels basiert und nutzt einzelne Spritebitmaps als Grundlage. jedes Panel hat ein window indem das sprite angezeigt wird (für Animationen). Nun habe ich ein paar fragen: 1.) Wie erstellt man ein Fülltool, um einen gerahmten bereich (x/y) zu füllen? 2.) wie kann man ein normalmapping und schattensystem wie in der Ethanon Engine erwirken? siehe: http://www.asantee.net/ethanon/3.) Gibt es einen Weg Partikel über Panels anzuzeigen? Aktuell liegen sie immer darunter ^^" ======================= i'm working on my 2D RPG Toolkit for a while now and finished the mapping system. Ir is based on Panels. Each Panel includes a window with a bitmap (a window for animations). now i've some questions: 1.) I've no idea how to create a filling tool to fill a framed area (x/y) of the map with selected tiles. Any idea how to do that? 2.) Is there any way to create a normalmapping and shadowmap system like the Ethanon Engine is doing it? See: http://www.asantee.net/ethanon/3.) How to push Particles above Panels? At the moment, they are shown below them  hoping for help  thx for reading
|
|
|
Re: 2D questions
[Re: Espér]
#403493
06/21/12 10:58
06/21/12 10:58
|
Joined: Jul 2001
Posts: 6,904
HeelX
Senior Expert
|
Senior Expert
Joined: Jul 2001
Posts: 6,904
|
1.) Explain it with some images, your notes are very vague in my oppinion 2.) Not with panels. Panels don't supprt shaders. 3.) Particles are part of the 3D scenery and can not interact with 2D panels. Panels are alwyays drawn above the rendered image.
If you want to achieve 2.) and 3.), you have to write a panel system that is settled in world space via e.g. sprites or quad's (meshes with two polygons, forming a rectangle).
Last edited by HeelX; 06/21/12 10:58.
|
|
|
Re: 2D questions
[Re: HeelX]
#403497
06/21/12 11:46
06/21/12 11:46
|
Joined: Apr 2005
Posts: 4,506 Germany
fogman
Expert
|
Expert
Joined: Apr 2005
Posts: 4,506
Germany
|
Quad drawing: http://www.conitec.net/beta/draw_quad.htmThe bmap_rendertarget function can be used to draw the quad into a bitmap. Particles over panels are possible since A8: The effect_layer function creates the effect outside the level, just like layered entities. This way effects can be placed on panels or follow the mouse pointer. Particles created with effect_layer are rendered on the media_layer, and use the view settings from the camera view. http://www.conitec.net/beta/aent-effect.htmI´m no shader programmer - maybe there is a way to realize normal or bump mapping through post processing? Then you could use bmap_process? Edit: Ninja´d by Rei...
Last edited by fogman; 06/21/12 11:48.
no science involved
|
|
|
Re: 2D questions
[Re: HeelX]
#403498
06/21/12 11:46
06/21/12 11:46
|
Joined: Mar 2008
Posts: 2,247 Baden Württemberg, Germany
Espér
OP
Expert
|
OP
Expert
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
|
1.)  I don't know how to say the script to fill f.e. all yellow pixels of a bitmap with red, until they reach a pixel with other color or red. 2. & 3.) hmm sounds bad  need to think about that..
|
|
|
Re: 2D questions
[Re: Espér]
#403499
06/21/12 11:50
06/21/12 11:50
|
Joined: Apr 2005
Posts: 4,506 Germany
fogman
Expert
|
Expert
Joined: Apr 2005
Posts: 4,506
Germany
|
Highly unstable and in no way bulletproof! (It works only with the right sized bmap. But it should give you a start) // Compares two VECTORS // v1 = Vector 1 // v2 = Vector 2 // returns: 1 if vectors match, otherwise 0 var VecCompare(VECTOR* v1, VECTOR* v2) { if(v1.x == v2.x && v1.z == v2.z && v1.z == v2.z) return(1); else return(0); }
VECTOR gvBmapSelectionColor; void BmapMagicWandExFill(BMAP* bmp, vPosX, vPosY, VECTOR* vFillColor, VECTOR* vSelectionColor) { if(vPosX < 0)return; if(vPosX > bmap_width(bmp)-1)return; if(vPosY < 0)return; if(vPosY > bmap_height(bmp)-1)return; var vAlpha; VECTOR vColor; var format = bmap_lock(bmp, 0); var pixel = pixel_for_bmap(bmp, vPosX, vPosY); pixel_to_vec(vColor, vAlpha, format, pixel); if(VecCompare(vColor, vSelectionColor)) { pixel = pixel_for_vec(vFillColor, 100, format); pixel_to_bmap(bmp, vPosX, vPosY, pixel); BmapMagicWandExFill(bmp, vPosX-1, vPosY, vFillColor, vSelectionColor); BmapMagicWandExFill(bmp, vPosX+1, vPosY, vFillColor, vSelectionColor); BmapMagicWandExFill(bmp, vPosX, vPosY-1, vFillColor, vSelectionColor); BmapMagicWandExFill(bmp, vPosX, vPosY+1, vFillColor, vSelectionColor); } bmap_unlock(bmp); }
// Magic Wand Fill tool - does a magic wand selection and fills it with vFillColor // bmp = pointer to bitmap // vPosX = x position of the selection point // vPosY = y position of the selection point // vFillColor = BGR fill color void BmapMagicWandFill(BMAP* bmp, vPosX, vPosY, VECTOR* vFillColor) { var vAlpha; var format = bmap_lock(bmp, 0); var pixel = pixel_for_bmap(bmp, vPosX, vPosY); pixel_to_vec(gvBmapSelectionColor, vAlpha, format, pixel); bmap_unlock(bmp); BmapMagicWandExFill(bmp, vPosX, vPosY, vFillColor, gvBmapSelectionColor); }
Last edited by fogman; 06/21/12 11:53.
no science involved
|
|
|
Re: 2D questions
[Re: HeelX]
#403503
06/21/12 12:38
06/21/12 12:38
|
Joined: Mar 2008
Posts: 2,247 Baden Württemberg, Germany
Espér
OP
Expert
|
OP
Expert
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
|
thx fogman - i'll take a look into it after work  Same with effect_layer this thing with normal+shadowmapping for panels is bad  Seems like i need to forget that idea 
|
|
|
Re: 2D questions
[Re: Espér]
#403504
06/21/12 13:24
06/21/12 13:24
|
Joined: Jul 2001
Posts: 6,904
HeelX
Senior Expert
|
Senior Expert
Joined: Jul 2001
Posts: 6,904
|
this thing with normal+shadowmapping for panels is bad  Seems like i need to forget that idea  Why? You could reprogram everything so that you could use sprites instead. With that, you can do also fancy postprocessing. Another reason for not using panels is that their coordinates, even though they are typed as var's, are snapped for drawing to integer coordinates. So, doing things like ->pos_x += 5 * time_step results in jittered motion. For RUDI, I have done falling snowflakes in the main menu with panels - the only solution to this was clamping fps_max and doing something like pos_y -= 1 each frame --- without the use of time_step. So, I rely upon the fact, that a regular computer renders the main menu with, say, 60 fps. For the credits, I have falling snow flakes, too, but this time I did everything in world space with sprites and so on. Here, I safely do ->z -= 5 * time_step or so. Another advantage is that rotated panels are not properly filteres as their sprite-counterparts in world space. Another advantage is that you have problems with the monitor resolution - if you do everything with sprites you can simply switch the resolution and the sprites don't change their relative size on the screen as if it happens when you use panels. Don't use panels for 2D games!
Last edited by HeelX; 06/21/12 13:25.
|
|
|
Re: 2D questions
[Re: HeelX]
#403508
06/21/12 13:54
06/21/12 13:54
|
Joined: Mar 2008
Posts: 2,247 Baden Württemberg, Germany
Espér
OP
Expert
|
OP
Expert
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
|
okay thanks for the constructive words *rises his fist* REPROGRAMMING started  new Question: 4.) How to recreate the animations of my panel system with sprites? I use Rpg-Maker XP System Characters and Autoriles.. Means multiple directions and frames in 1 bitmap... with window, i only showed up one tile or charaframw i needed - how to do that with sprites?
Last edited by Espér; 06/21/12 13:57.
|
|
|
|