Author Topic: Philippines in the maze  (Read 9204 times)

0 Members and 1 Guest are viewing this topic.

Offline Dav

  • Forum Resident
  • Posts: 792
    • View Profile
Re: Philippines in the maze
« Reply #30 on: August 23, 2020, 07:50:49 am »
Beautiful looking!  I especially like the cool touches like flying butterfly.  I download it and am scanning it over the code.  I don't see the problem yet, but will dig into it more today.  I thought too many opened images in a loop may be the culprit, but I dont see it.

- Dav
« Last Edit: August 23, 2020, 07:52:01 am by Dav »

FellippeHeitor

  • Guest
Re: Philippines in the maze
« Reply #31 on: August 23, 2020, 09:24:00 am »
A memory leak. Something is being loaded inside a loop. I'll have a look at the code in the package and see if I spot anything.

FellippeHeitor

  • Guest
Re: Philippines in the maze
« Reply #32 on: August 23, 2020, 11:15:15 am »
A memory leak. Something is being loaded inside a loop. I'll have a look at the code in the package and see if I spot anything.

Whoa, I take it back. Nothing is being loaded inside the main loop. You've got a unique situation here.

I'll keep looking, but before I continue, let me just say this: I didn't follow the discussion on this project so closely and I'm late to the "blown away" party: No SUB _GL??? This is all _MAPTRIANGLE??? Cool work, man!

Offline MasterGy

  • Seasoned Forum Regular
  • Posts: 327
  • people lie, math never lies
    • View Profile
Re: Philippines in the maze
« Reply #33 on: August 23, 2020, 02:28:23 pm »
thanks so much for looking at where the error might be, it loads everything at first, not after that, but works from what is loaded. i don't understand what could be wrong. Yes, it only contains _MAPTRIANGLE.

Offline Dav

  • Forum Resident
  • Posts: 792
    • View Profile
Re: Philippines in the maze
« Reply #34 on: August 23, 2020, 03:01:33 pm »
I'm sorry I haven't been able to lock it down yet.  I don't see a image loading in a loop.  Could it be a recursive routine?  I'll have to play with it more. 

After a minute or two of navigating the map I get this Alert popup box:
"list add: failed to allocate new buffer, structure size:"

Then this Alert pops up:  "116". 

Then the program crashes.

Once I got a Subscript out of range error on line #460.

- Dav

Offline Galleon

  • QB64 Developer
  • Newbie
  • Posts: 25
    • View Profile
Re: Philippines in the maze
« Reply #35 on: August 26, 2020, 06:24:05 am »
The leak is because of the way QB64 does error handling vs the C stack. The good news is if you fix the error (which is an array out of bounds error looking up a pictri2 index) you also fix the memory leak.

Code: QB64: [Select]
  1.     FOR act_ani = 0 TO ani_db - 1
  2.  
  3.         outOfBounds = 0
  4.         IF ani(act_ani, 0) THEN
  5.             merx = ani(act_ani, 5) / 2: merz = ani(act_ani, 6) / 2: wx = points2(ani(act_ani, 1), 4): wy = points2(ani(act_ani, 1), 5): wz = points2(ani(act_ani, 1), 6)
  6.             wx1 = wx - merx: wy1 = wy - merx: wz1 = wz: wx2 = wx + merx: wy2 = wy - merz: wz2 = wz: wx3 = wx - merx: wy3 = wy + merz: wz3 = wz
  7.  
  8.  
  9.             pictri2index = ani(act_ani, 4)
  10.             IF pictri2index > UBOUND(pictri2) THEN outOfBounds = 1
  11.             IF outOfBounds = 0 THEN
  12.  
  13.  
  14.                 IF ani(act_ani, 8) THEN
  15.  
  16.                     ksx1 = 0: ksy1 = _HEIGHT(pictri2(ani(act_ani, 4))) - 1: ksx2 = _WIDTH(pictri2(ani(act_ani, 4))) - 1: ksy2 = ksy1: ksx3 = 0: ksy3 = 0: ksx4 = ksx2: ksy4 = ksy3
  17.  
  18.                 ELSE
  19.  
  20.  
  21.                     ksx1 = _WIDTH(pictri2(ani(act_ani, 4))) - 1: ksy1 = _HEIGHT(pictri2(ani(act_ani, 4))) - 1: ksx2 = 0: ksy2 = ksy1: ksx3 = ksx1: ksy3 = 0: ksx4 = 0: ksy4 = ksy3
  22.  
  23.  
  24.                 END IF
  25.  
  26.  
  27.                 sx1 = ksx1: sy1 = ksy1: sx2 = ksx2: sy2 = ksy2: sx3 = ksx3: sy3 = ksy3
  28.  
  29.                 ihandle& = pictri2(ani(act_ani, 4))
  30.                 IF ihandle& <> 0 THEN
  31.                     _MAPTRIANGLE (sx1, sy1)-(sx2, sy2)-(sx3, sy3), pictri2(ani(act_ani, 4)) TO(wx1, wy1, wz1)-(wx2, wy2, wz2)-(wx3, wy3, wz3), , _SMOOTH
  32.                     wx1 = wx + merx: wy1 = wy + merx: wz1 = wz: wx2 = wx + merx: wy2 = wy - merz: wz2 = wz: wx3 = wx - merx: wy3 = wy + merz: wz3 = wz
  33.                     sx1 = ksx4: sy1 = ksy4: sx2 = ksx2: sy2 = ksy2: sx3 = ksx3: sy3 = ksy3
  34.                     _MAPTRIANGLE (sx1, sy1)-(sx2, sy2)-(sx3, sy3), pictri2(ani(act_ani, 4)) TO(wx1, wy1, wz1)-(wx2, wy2, wz2)-(wx3, wy3, wz3), , _SMOOTH
  35.                 END IF
  36.  
  37.  
  38.             END IF
  39.  
  40.         END IF
  41.     NEXT act_ani

Offline MasterGy

  • Seasoned Forum Regular
  • Posts: 327
  • people lie, math never lies
    • View Profile
Re: Philippines in the maze
« Reply #36 on: September 09, 2020, 02:20:30 pm »
Hi !
I finally managed to make sure it didn’t stop with “out of memory”. Resolved by resizing the textures. Although I don't understand the connection, why would that be a problem?
Innovation:

-So far as I found images of texture on the net, I put them in their original form in the game folder. I had to figure out that what is 5 high on the screen should be 5x pixels. What is 10 high is 10x pixels, so the size of the image should be proportional to the size used in the game. The quality of the textures can be adjusted universally at the beginning of the creator, and he will scale the raw images accordingly, taking into account their size used in the game. It was a good idea, the “out of memory” was eliminated, and the size of all the images created in this way was 20% of the size of the original, so that there was no noticeable deterioration in quality.

-Old object perception proved to be slow. In vain I divided the space into cells to examine only those objects that are close, for example, at 2,000 butterflies the whole thing slowed down… believe then at 20 fps 20x2000 butterflies per second x pl 30 objects, then the multiplication of 18000 x6, sin, cos… sir god. i threw out this solution and as it is, the creator fills a high resolution 3d bit matrix so a lot of computation is saved because with a simple situation proportional reading I get whether there is YES or NO material. So the size of the array will be hundreds of Mb, but well… something for something!

-I also refined the controls to make it more ergonomic. For example, if you are going against the wall, do not stop, but look for the angle so that you can pass. This is how all fps games work, so it was mandatory for me to solve.

-I thoroughly reviewed what calculations could be used to save time and simplify. During filming, I found something that was unnecessary in the old versions. I saved resources.

The result is that I feel like the engine that works very efficiently on _maptriangle has finally been born. When you start the game, you can see that there is no need to limit the number of maptriangles. The main cycle is set to 20 –fps (_LIMIT), but if you press the L button, it will release (no limit) and you can really see that everything is visible, lots of snapshots, animated images, and lots of resources left. This will be important later. It finally runs fast, flexibly, doesn’t crash.

https://drive.google.com/file/d/1xGQeHCFSs7_XIpQ9pv2u3N_NR2jPn-W4/view?usp=sharing

Offline MasterGy

  • Seasoned Forum Regular
  • Posts: 327
  • people lie, math never lies
    • View Profile
Re: Philippines in the maze
« Reply #37 on: September 09, 2020, 02:23:58 pm »

Now I'm reading your solution Galleon! Yet I look up regularly and even wait. whether someone writes and your last answer completely escaped my attention! :( I’m reading now that I’ve unloaded this. Thank you so much for dealing with it, I will enroll you in the program so there are no more. I am very happy, thank you for the explanation !!!

Offline MasterGy

  • Seasoned Forum Regular
  • Posts: 327
  • people lie, math never lies
    • View Profile
Re: Philippines in the maze
« Reply #38 on: September 26, 2020, 03:02:15 pm »
Hi !

-Preform color channels can be created by pre-mixing the textures.
-Additional objects, architectural solutions.
-Gate system

Next, I set up a system in which the key-gate principle is realized either passively or by task, and it is possible to go through otherwise linear random trajectories by completing quests.
The video shows 3 tracks with different color mixes.




Offline MasterGy

  • Seasoned Forum Regular
  • Posts: 327
  • people lie, math never lies
    • View Profile
Re: Philippines in the maze
« Reply #39 on: October 03, 2020, 02:30:29 pm »
Hi !

Lots of small fixes, things work. I've been exhausted for something lately.

have you ever looked at the source code and understood nothing? I need inspiration to continue, so that I can't even figure out on paper how to create the key-gate… character-object principle, which will then randomly generate a series of tasks, so the course of the game. I got stuck, it makes no sense for me to deal with it that way. I hope the inspiration will be there as soon as possible and I can finish.

in the meantime i put the save in the cloud, share it if you feel like it, try it. ergonomic handling, linear layout, gates where they should be. Minimal gaming experience comes from finding the qb logo. That is it for now.

https://drive.google.com/file/d/1JIrVMT3CN05-MfDhXdZVIfj8N0wWJSVw/view?usp=sharing