English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 18 April 2018, 21:41   #1
peceha
Registered User
 
peceha's Avatar
 
Join Date: Dec 2017
Location: Poland
Age: 48
Posts: 284
GetaShape freezes my Amiga

Hi,

could someone tell me what's wrong in here:
Code:
#G     =16

BitMap 0,640,512,2
LoadBitMap 0,"ram:gfx_hero.iff",0

cnt.w=1000   ;      <<<<---- THIS ONE IS MAKING TROUBLE
For y.b=0 To 8
  For x.b=0 To 7
    GetaShape cnt,x*#G,y*#G,#G,#G
    cnt+1
  Next x
Next y

Free BitMap 0
Print "done"
MouseWait
The important thing here is "cnt" - when it is set to 500 I can run this code as many times as I want. When I set cnt=1000 then I can run this only once - the second time I run the code my Amiga freezes, cannot move the mouse, and no guru shows up.
I'm talking about Blitz 2.1 (max shapes number in compiler setting is set to 2000).

Thanks
peceha is offline  
Old 19 April 2018, 00:33   #2
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,393
Certain Blitz objects cause crashes when the maximum object count is too high - the buffer size wraps around and trashes memory. I think you're hitting this bug, it's one of the things that was fixed in Amiblitz 3.

Do you really need more than 1000 shapes? I would suggest recycling shapes that are used for drawing maps etc. if that's what you're doing. Otherwise AmiBlitz 3 should work.
Daedalus is online now  
Old 19 April 2018, 07:17   #3
peceha
Registered User
 
peceha's Avatar
 
Join Date: Dec 2017
Location: Poland
Age: 48
Posts: 284
Thanks Daedalus.
I will consider moving to AmiBlitz3.

At the moment I have something like this:
[ Show youtube player ]

In that video the maze has a dimentions 20x16 so it makes 320 shapes but if I want a bigger maze (eg.40x32) then I need more than 1000 shapes.
Hmmm... I will have to find a different way, maybe instead of "1 title" = "1 shape" I will do "all the same tiles" = "1 shape" and that will reduce the amount of shapes...

Thanks a lot ! as always I have some new ideas after reading your answers , hehe
peceha is offline  
Old 23 April 2018, 14:43   #4
Predseda
Puttymoon inhabitant
 
Predseda's Avatar
 
Join Date: Mar 2007
Location: Tromaville
Age: 46
Posts: 7,599
Send a message via ICQ to Predseda
This looks very promissing, fingers crossed in it. Fits to my favourite genre.
Predseda is offline  
Old 23 April 2018, 17:04   #5
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,393
Oops, I thought I replied to this ages ago, but turns out I didn't...

Quote:
Originally Posted by peceha View Post
In that video the maze has a dimentions 20x16 so it makes 320 shapes but if I want a bigger maze (eg.40x32) then I need more than 1000 shapes.
Yep, that's definitely not an efficient way of doing things...

Quote:
Hmmm... I will have to find a different way, maybe instead of "1 title" = "1 shape" I will do "all the same tiles" = "1 shape" and that will reduce the amount of shapes...
Yep, that's much more like it The normal way most games and map makers do this is to assign each different tile type a number, and then build the level from an array of numbers, each one representing a particular type of tile. In that way, a simple maze-type engine can be built using quite a small number of tiles - maybe 20 or 30, leaving plenty of space (both in the Shapes object list and in chip RAM) for adding other content.
Daedalus is online now  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Wblit or Getashape - one of them makes me nervous peceha Coders. Blitz Basic 20 30 March 2018 10:22
Amiga 500+ freezes after clicking on icons Chris__ support.Hardware 2 21 April 2016 10:38
My amiga freezes because of select.gadget prefs??? keropi support.Apps 5 15 December 2005 11:27
After using a theme, visualprefs freezes the amiga... keropi support.Apps 4 02 December 2005 21:55
The Amiga freezes Fackamato support.Hardware 15 15 February 2005 09:46

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 13:23.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.11208 seconds with 13 queries