Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Work in Progress / tiny invaders [please test]

Author
Message
Yian
21
Years of Service
User Offline
Joined: 16th Jun 2003
Location: Nicosia, Cyprus(the Greek half)
Posted: 7th Sep 2006 03:12 Edited at: 7th Sep 2006 03:21
hello ladies and gentlemen!
all I ask of you is that you test this unfinished game I'm making, called 'Tiny Invaders',its all about shooting birds with a sling.
due to some bugs with the dbp particle system I had to go make my own.
However it seems to have some problems.
can you please see if:

- you get an array out of bounds error usually when shooting the tree a lot

- there is a *slowdown* when the leaf particles start *fading out*

here is the file:
http://66.148.84.12/~jeriko/tiny%20invaders.rar



thank you very much!!

What is happening to them[the children] is the only thing they've known. The whole system of values is turned upside down: a child is appreciated and loved if it earns money by stealing

Attachments

Login to view attachments
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 8th Sep 2006 00:05
You didn't put a download link

There are three types of people, those that can count and those that can't.
JerBil
20
Years of Service
User Offline
Joined: 8th May 2004
Location: Somewhere along the Z axis...
Posted: 8th Sep 2006 04:12
I do get array out of bounds error shooting at the tree, but
the program won't compile, either.

When compiling I get the error
"Subscript must be Integer or DWORD when referencing an array at line 206"

Line 206:


Ad Astra Per Asper
Yian
21
Years of Service
User Offline
Joined: 16th Jun 2003
Location: Nicosia, Cyprus(the Greek half)
Posted: 8th Sep 2006 20:47
ok thanks for testing!
Jerbil you need the latest version of sparky's collision dll for it to compile.

What is happening to them[the children] is the only thing they've known. The whole system of values is turned upside down: a child is appreciated and loved if it earns money by stealing
thebulk71
18
Years of Service
User Offline
Joined: 2nd Jan 2006
Location: takin a poop
Posted: 9th Sep 2006 12:05
Hi there... I guess this is an early stage from what I've seen... I have made a few functions that might just interest you for they correspond exactly to what you are making (simple physics engine for the balls and a full FPS movement system... they could shorten your code out a bit...) I'd be really willing to give them to you if you want... I also had a quick look at your code but I didn't find the part that makes your leaves fade out... that's great how do you do it?

anyhow... keep to it it's coming on fine.

thebulk
Yian
21
Years of Service
User Offline
Joined: 16th Jun 2003
Location: Nicosia, Cyprus(the Greek half)
Posted: 9th Sep 2006 16:54 Edited at: 9th Sep 2006 17:02
greetings,this is indeed an early stage,thank you for trying !
the leaf image is a PNG with a transparent backround,and I simply 'set alpha mapping on' , its in the run_fparts() function

you didn't encounter any array out of bounds when shooting repeatedly at the tree?

thanks for offering your functions,I'd like to take them on board if they can be used as you say.

What is happening to them[the children] is the only thing they've known. The whole system of values is turned upside down: a child is appreciated and loved if it earns money by stealing
bosskeith
18
Years of Service
User Offline
Joined: 5th Dec 2005
Location:
Posted: 10th Sep 2006 08:19
rapid fire into tree gives "Runtime Error 118-Array does not exist or array subscript out of bounds at line 347" although it does die i like how you did the leaves.

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 12th Sep 2006 17:38
Yes, I get the same error - several different ways.

Why don't you just insert some code to print out various things to help you work out what's gone wrong. I tried the following around lines 346/347 (but you will probably need to add a bit more print out to narrow down the problem further):



As an afterthought, have you checked whether you've assumed "array count(parts(0))" gives you the number of items in the array or the number of the final entry? [Remember arrays start at zero, so an array with one element in it (at position 0) will return a value of 0 from array count.] Could this be your problem?
thebulk71
18
Years of Service
User Offline
Joined: 2nd Jan 2006
Location: takin a poop
Posted: 12th Sep 2006 21:26
OK well, first of all yes, I did encounter an out of bounds error when I shot the tree many times... as for my functions they use sparky's free collision dll... so I'va attached them... hope it works

Attachments

Login to view attachments
Yian
21
Years of Service
User Offline
Joined: 16th Jun 2003
Location: Nicosia, Cyprus(the Greek half)
Posted: 14th Sep 2006 11:57 Edited at: 14th Sep 2006 11:58
thank you for the report and the functions, thebulk! I will try to implement them a soon as I fix this troublesome bug...

Green Gandalf thank you for taking the time to examine the code!
I have indeed used the code you offered with the wait key to observe that, the pbunch(pb).ear is higher than the actual pcount.
I'm not sure I understood your comment about array count(), I have taken it to mean the number of items in an array,but I do not count the 0 item,as I never use it in any of my arrays, as you see in this code for example :


thanks to all who helped by testing !

What is happening to them[the children] is the only thing they've known. The whole system of values is turned upside down: a child is appreciated and loved if it earns money by stealing
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 14th Sep 2006 15:05
I don't think those lines are the problem. Look at where the numbers for pt come from near where I made the code suggestion earlier (I think it was pt - I haven't got the code here).

I've got a long train journey tomorrow. Might go through the code more carefully for you. (Risk is I might get so engrossed that I miss my station!)
Yian
21
Years of Service
User Offline
Joined: 16th Jun 2003
Location: Nicosia, Cyprus(the Greek half)
Posted: 14th Sep 2006 17:57
thanks for replying!
I've been looking at the code a lot,especially the part you just mentioned... so its bound to be something about that.
It would indeed be very generous if you could study the code,but no hurries man! don't want you ending up in York instead of Southampton!

What is happening to them[the children] is the only thing they've known. The whole system of values is turned upside down: a child is appreciated and loved if it earns money by stealing
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 14th Sep 2006 22:08
Could the problem be the asterixed line in the following?



Looks potentially dodgy because you have set pbunch(pbc).sar to one more than the last entry in the parts() array - and I think the code may fail in the following section as a result (I've marked the suspect lines):



At first sight it looks as if:

1. pbunch(pb).ear could be set to 1 more than the number of entries in parts();
2. pt could be set to this value;
3. parts(pt).status would then throw the error.

I'd look there first.
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 14th Sep 2006 22:41 Edited at: 14th Sep 2006 22:49
I think I know what is wrong, when a leaf has faded and you need to delete it, you delete the array element with it. That means that anything above it will be moved down, but the references will not be changed. All you need to do is take away one from all the references that refer to an array index higher than the recently deleted element.

edit:

insert this code after you delete a leaf(lines in the high 300s in the run_fparts function) There should be 2 places



This will fix your problem

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 15th Sep 2006 01:36
Tried your suggestion - without success. Probably put correction in the wrong place. Could you be more specific?
Yian
21
Years of Service
User Offline
Joined: 16th Jun 2003
Location: Nicosia, Cyprus(the Greek half)
Posted: 15th Sep 2006 05:27
OK people thanks for all this help and suggestings !
I've made some changes to the code, I've attached the new version..
the changes are that
- now the 0 item of the array is used (doesnt start from 1st)
- (line 355) I tried implementing Diggsey's suggestion (tired his code butdidn't work) , however the error still comes.

What is happening to them[the children] is the only thing they've known. The whole system of values is turned upside down: a child is appreciated and loved if it earns money by stealing

Attachments

Login to view attachments
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 15th Sep 2006 21:50 Edited at: 15th Sep 2006 21:52
I can't be sure of the line, because I inserted the code, but 2 lines after you write delete object <leafobject>

here is the whole code which works:


edit:
And I knocked my own thread down to second when I posted this, so You'd better thank me

Yian
21
Years of Service
User Offline
Joined: 16th Jun 2003
Location: Nicosia, Cyprus(the Greek half)
Posted: 16th Sep 2006 06:38
you have indeed solved the problem!! many thanks man,and to all the others who helped!
could you explain how it works though? I tried this :

(line 355) but it didn't work...
thx again man!

What is happening to them[the children] is the only thing they've known. The whole system of values is turned upside down: a child is appreciated and loved if it earns money by stealing
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 16th Sep 2006 11:51 Edited at: 16th Sep 2006 11:52
You store each leaf an array, and store its index number in another array. When the leaf is deleted, you delete the reference to it, but you also need to decrease the index number for all higher leaves, because when you delete an array element, all of the items above that element are moved down to fill the space. This means that if you don't decrease all of the references that they point to an index higher than the size of the array.

This only happens when more than one leaf effect is being played.

My code just decreases the references to the array which are higher than the element deleted.

Yian
21
Years of Service
User Offline
Joined: 16th Jun 2003
Location: Nicosia, Cyprus(the Greek half)
Posted: 16th Sep 2006 13:02
indeed, but if you observe the code in my last post,trying to do so with this method :

didn't work. I'm most thankful that you found a working solution though!

What is happening to them[the children] is the only thing they've known. The whole system of values is turned upside down: a child is appreciated and loved if it earns money by stealing
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 16th Sep 2006 18:07
Well done Diggsey

Login to post a reply

Server time is: 2024-11-23 20:01:09
Your offset time is: 2024-11-23 20:01:09