largest room size

Started by lafouine88, Thu 18/07/2024 22:31:09

Previous topic - Next topic

lafouine88

Quote from: Crimson Wizard on Fri 23/08/2024 14:20:29This is not a plugin!..
Can you tell what do you do, step by step, and what exactly happens as a result?

So:
-I dl your .exe (definitely not a plugin :p) and ,after renaming the initial one, extracted it to my adventuregalmestudio 3.6.1 root folder.
-I imported the bmp file, and ticked transaprency top left pixel. Nothing else.
-I removed the walkable areas of the room
-at room load set this code :
Code: ags
   

DrawingSurface *ds = GetDrawingSurfaceForWalkableArea();
 ds.Clear(0);
 ds.DrawImage(2005, 1420, 5760); ///This is with your file,since it's just 320*200 I could not put it at 0,0 or it would be too far from my character so I set it manually so the blue area is below the character.
 ds.Release();


The game loads, but my character cannot move

Crimson Wizard

Quote from: lafouine88 on Fri 23/08/2024 15:27:32The game loads, but my character cannot move

Do you have these debug controls in the on_key_press somewhere?

Code: ags
  else if (mod & eKeyModCtrl)
  {
    if (keycode == eKeyA)
    {
      // Ctrl-A will show walkable areas
      Debug(2, 3);
    }
  }

If not, try inserting this code.
And then press Ctrl + A in this room, and see how the walkable areas actually look like in game.

Do you call "remove" or "restorewalkablearea" somewhere in script?

lafouine88

Hi, I was on the road this last days so I couldn't try earlier, as eager as I was^^

So using the debug mode definitely helped, it semms there was a problem with the coordinates. I don't know why but when I set it to map coordinates like 2000,1400 it didn't show anywhere, but when I corrected to player.x-150; player.y-70 (which led to the same values) it worked.
So I stil have a bit of set up to work on, but the core of the problem really is solved. Thanks a million to everybody, especially to @Crimson Wizard for his patience.

As soon as I have a clean code I'll edit my post with the correct way to make this :) :)

Crimson Wizard

Quote from: lafouine88 on Tue 27/08/2024 21:44:47So using the debug mode definitely helped, it semms there was a problem with the coordinates. I don't know why but when I set it to map coordinates like 2000,1400 it didn't show anywhere, but when I corrected to player.x-150; player.y-70 (which led to the same values) it worked.

This is not expected, there should not be any difference if the values are actually same. Can you post the code which you used?

lafouine88

Hello again

So after a few tries, I realized there was a 'RemoveWalkableArea()" lost somewhere in my messy code. I think it's @eri0o who told me in another post that the hard part was to keep your code and functions clear... "^^
When I tried earlier this week it was on another computer with an older code(and no removewalkablearea) that's why it worked there and not on my home computer. After all coordinates were not a problem, sorry for the disturbance @Crimson Wizard -_-

One last thing, since i'm now working on walkbehind, how do you change the baselines ? I went for " SetWalkBehindBase(1, X)" since I figured the drawing surface applied to walkable area1 because of the blue color but it doesn't seem to be the case.

Crimson Wizard

So, I found that after painting walkbehinds engine does not update the walkbehind "cuts", so they would never cover the character.
This is another thing that was not tested properly.

All this feature is filled with mistakes, I must retest it fully, for all region types, and patch in 3.6.1

lafouine88

Thanks for the reply. My project is planned for christmas 2025 so maybe by then the engine wille be patched and I can include the walk behinds.

Thanks everybody for your help, I will edit the post soon to sum up the elements we gathered :)

See you

Crimson Wizard

Here's an updated version, with walk-behinds problem fixed:
https://cirrus-ci.com/task/6249807860203520

(this is a full editor download from our build server)

lafouine88

#48
Works great. Many, many thanks  :grin:  :grin:  :grin:

EDIT : One small thing though, the loading time (during the transition and new setting of the overlay,and drawing surfaces) is a bit longer since I added the new code for drawing surface. I downloaded the executable file in the "install" folder, but maybe I missed something ? Or is it just that walk behind are longer to settle?

Crimson Wizard

#49
Quote from: lafouine88 on Sun 01/09/2024 19:50:28EDIT : One small thing though, the loading time (during the transition and new setting of the overlay,and drawing surfaces) is a bit longer since I added the new code for drawing surface. I downloaded the executable file in the "install" folder, but maybe I missed something ? Or is it just that walk behind are longer to settle?

Every operation takes time, painting a very big image takes noteable amount of time, plus engine has to parse pixels and "cut out" walk-behind sprites.

If the operation is the same, but takes longer than in the previous version unexpectedly, then that's something to investigate. I could not tell whether this is the case from what you've said, if it is, then please clarify that?

Speaking of walk-behinds in particular, if you want to speed things up then you may just create game objects or room overlays with background portions on them instead. Then you won't need to use the walk-behind mask. They will still take time to load up, but engine will not have to do copy-pasting on a surface, and then cutting things out again.

lafouine88

Quote from: Crimson Wizard on Mon 02/09/2024 11:49:44If the operation is the same, but takes longer than in the previous version unexpectedly, then that's something to investigate. I could not tell whether this is the case from what you've said, if it is, then please clarify that?
Well in the previous versions, adding regions or walkable areas didn't slow down anything (compared to just changing the background overlay), it's really when I added the walkbehind area that I noticed a change...

Quote from: Crimson Wizard on Mon 02/09/2024 11:49:44Speaking of walk-behinds in particular, if you want to speed things up then you may just create game objects or room overlays with background portions on them instead. Then you won't need to use the walk-behind mask. They will still take time to load up, but engine will not have to do copy-pasting on a surface, and then cutting things out again.
...But I think using overlays is much faster, not to mention it saves the drawing time which can be quite long, so yeah I'll definitely go for that :)

Thanks...again... "^^

SMF spam blocked by CleanTalk