18 August 2011, 11:26 | #81 |
it's all in your head
Join Date: Feb 2011
Location: The Netherlands
Posts: 174
|
Thank you.
I've now written down a list of things to be done on the code and gfx side. When I started I was still learning Blitz, so a lot of code had to be rewritten later, and I'm still in that process. Several things, like the casting menu, haven't made it on that list. Nevertheless, this is the first time I can say that, once these things make it into the game, it will be ready for the masses! It will be a small world beta test, but I expect it will be fun. |
19 August 2011, 11:58 | #82 |
it's all in your head
Join Date: Feb 2011
Location: The Netherlands
Posts: 174
|
Question: I'm trying to share an array of newtypes in a function. The newtype is called .obj and the array (objects.obj) holds data for several objects. Somehow this doesn't work: maingame.bb Code:
; newtype definition INCLUDE "obj_newtype.bb" ; object array objects_n=3 Dim objects.obj(objects_n) INCLUDE "obj_icheck.bb" Code:
Function obj_icheck{ obj_i } SHARED objects ... If objects(obj_i)\status = 0 ... |
19 August 2011, 18:28 | #83 |
Total Chaos forever!
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
|
I'm more of a C and AmigaE expert but here's a thought: Maybe you shouldn't be using an array to hold your objects directly. You've already got a type specification for a structure. I'm not sure if Blitz2 supports references to objects but that's got less overhead than passing an array reference and an offset and indexing each time you use an object.
In Assembly it would be implemented as a pointer held in an address register to each structure, then passing the pointer to the specific structure to your obj_icheck so that you're doing the indexing only once. I hope this helps. |
20 August 2011, 00:51 | #84 |
Moderator
Join Date: Jul 2004
Location: Norwich, Norfolk, UK
Age: 37
Posts: 11,167
|
For starters if you're going to share arrays, you must include the brackets too - so it'll have to be SHARED objects().
Have you tried not using Includes and just putting all the relevant code into one source file? Maybe, for whatever reason, the compiler just doesn't like you using Includes in this situation, I'm not sure. |
20 August 2011, 01:04 | #85 |
it's all in your head
Join Date: Feb 2011
Location: The Netherlands
Posts: 174
|
When I use SHARED objects() the error changes to "Syntax error", relating to:
Code:
If objects(obj_i)\status = 0 Thanks for the help. |
21 August 2011, 15:52 | #86 |
it's all in your head
Join Date: Feb 2011
Location: The Netherlands
Posts: 174
|
It's working!
I just threw in the Dim in the obj_icheck.bb. Now I can REALLY make everything bounce and slide whenever I want, woohoo! I've also finally set up a null-modem cable link with my old A1200 so I can test the game on a true original Amiga. |
21 August 2011, 22:20 | #87 |
Moderator
Join Date: Jul 2004
Location: Norwich, Norfolk, UK
Age: 37
Posts: 11,167
|
Nice work man
I look forward to covering your work in Amiga Future at some point when you're at the stage where people can play it |
22 August 2011, 16:33 | #88 | |
it's all in your head
Join Date: Feb 2011
Location: The Netherlands
Posts: 174
|
Quote:
Meanwhile, I'm coding in some axe throwing. :-) Last edited by r0ber7; 22 August 2011 at 17:13. |
|
25 August 2011, 23:25 | #89 |
it's all in your head
Join Date: Feb 2011
Location: The Netherlands
Posts: 174
|
The game is coming along nicely. Start menu and intro are done, and I've added a new enemy and some other stuff too. Now, for my question (as always).
I need help calculating the trajectory of things that get thrown around in a straight line, like fireballs and axes. B = starting point (start_x, start_y) A = target (dest_x, dest_y) Right now I do this: First I calculate the length of the hypotenuse, and determine velocity and set timer to zero. Code:
v = 8.5 t = 0.0 boo = (start_x-dest_x)*(start_x-dest_x) baa = (start_x-dest_x)*(start_x-dest_x) hyp = Sqr( boo + baa ) Code:
t = t + 0.5 boo = (dest_x-start_x) * v * t baa = (dest_y-start_y) * v * t x = start_x + boo / hyp y = start_y + baa / hyp |
26 August 2011, 01:19 | #90 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
The fastest way is to use an iterative approach and calculate the directional vector and scale its length to that of your velocity, and simply add this vector to the position every frame:
Code:
Initialization: dx = dest_x - pos_x dy = dest_y - pos_y scale = velocity / sqrt(dx*dx + dy*dy) dx = dx*scale dy = dy*scale For every image frame: pos_x = pos_x + dx pos_y = pos_y + dy |
26 August 2011, 10:38 | #91 |
it's all in your head
Join Date: Feb 2011
Location: The Netherlands
Posts: 174
|
Awesome! It's working, at blazing speed! Thank you, this has been troubling me for a long time. |
27 August 2011, 23:54 | #92 |
it's all in your head
Join Date: Feb 2011
Location: The Netherlands
Posts: 174
|
So, I'm at the point that I've put in so much stuff I get out of memory errors.
I have several ideas to get rid of these, some are a bit too code specific to mention here. But, one things bugs me a bit. There's a start menu. After clicking "play" the game starts. Then after you die or hit escape, you go back to menu. Before the menu loads I do this: Code:
stopmodule for r=0 to 10 : free sprite r : next for r=0 to 99 : free shape r :next for r=0 to 5 : free bitmap r : next for r=0 to 3 : free palette r : next Last edited by r0ber7; 28 August 2011 at 00:42. |
28 August 2011, 11:06 | #93 |
it's all in your head
Join Date: Feb 2011
Location: The Netherlands
Posts: 174
|
Would an array of 640 quicks take up a lot of mem? I have two approaches to ground detection, one involves an array. Is there a way to see which things occupy how much memory?
|
28 August 2011, 21:47 | #94 |
it's all in your head
Join Date: Feb 2011
Location: The Netherlands
Posts: 174
|
Solved memory problems, I didn't realize Free Coplist was an option. Game is running faster than ever before. I have room to add some spicey stuff I've been planning, it's way too fast now.
|
30 August 2011, 23:33 | #95 |
it's all in your head
Join Date: Feb 2011
Location: The Netherlands
Posts: 174
|
Ok guys, a quick update.
I've worked on the game a lot the last week and there are only a few things left to add before I can release world 1 as alpha test. There will be 2 gameplay modes. In the first one (adventure) you follow the storyline. In the other one (survival) you blast vikings for points until you die. Before first release these are left to do: - a proper "getting hit & dying" procedure for the wizard (right now it's just halfway) - different ingame music which better suits the atmosphere - highscores - fix a few glitches - test on a real A1200, and in WinUAE (developing in e-uae on linux) I've added quite a bunch of stuff, which I won't share until first release. :P Also don't expect too much, world 1 isn't very big because it's drawn by hand. Well, by mouse. No random generation of objects or anything. It's an island of 1280x256, but it's big enough to fight vikings on, heh. The coming two weeks I'll be starting at my new job, so I probably won't have much energy to work on this. Which is why I'm posting this too, just to say, I will release at least this one world in the near future. Seeing how winter is coming, it's quite likely I'll be adding worlds and updating after first release. So I could say, "expect an alpha release in late september", but I won't because I don't like having a deadline. So no promises. But it'll probably happen anyway. Last edited by r0ber7; 31 August 2011 at 00:02. |
31 August 2011, 05:29 | #96 |
Lone CBM user
|
Sweet cannot wait for a look at the real thing.
|
05 September 2011, 18:38 | #97 |
it's all in your head
Join Date: Feb 2011
Location: The Netherlands
Posts: 174
|
I've actually been coding in between shifts. I said no deadlines, but hey. If all goes well...
First alpha release: september 11th. Will be announced in the EAB Gaming Factory. |
05 September 2011, 22:47 | #98 |
AMOS Extensions Developer
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
|
Cool. I hope you make your deadline (or thereabouts) as I have the week after that off work. Plenty of time to play your alpha release
(don't worry if you miss your deadline, my demo is 4 months later than planned and still not finished!!) Regards, Lonewolf10 |
06 September 2011, 17:28 | #99 | |
it's all in your head
Join Date: Feb 2011
Location: The Netherlands
Posts: 174
|
Quote:
P.S. Considering this is a Coder's Heaven, I'll only post coding related stuff in this thread from now on. Anything else will be in the Game Factory. |
|
06 September 2011, 19:14 | #100 |
Moderator
Join Date: Jul 2004
Location: Norwich, Norfolk, UK
Age: 37
Posts: 11,167
|
You got a name for this game yet? Or are you waiting until the 11th before you reveal it?
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Blitz2: Hires laced | BippyM | Coders. Language | 25 | 06 February 2020 01:07 |
Blitz2 keyboard issues | htdreams | Coders. Blitz Basic | 2 | 16 August 2013 15:58 |
Blitz2 Newcommandset | BippyM | Coders. Language | 0 | 21 July 2012 23:59 |
Blitz2 Manual | AlfaRomeo | Amiga scene | 18 | 01 May 2009 10:53 |
Embed data in Blitz2 programs | oRBIT | Coders. General | 25 | 06 April 2007 19:49 |
|
|