Re: Car game

2007-06-10 Thread Calvin Allett
Yeah, I suppose I know what you mean :) I just meant with the pace of 
development with Basic, however with the amount of time it takes to actually 
get something running fast/smooth on the SAM in Basic, I`m starting to think 
the gap may not be so large, i.e. it might be faster development wise to just 
do stuff in MC, as wouldn`t need such `polishing` for months :)

anyway, just wanted to apologise for not putting a demo of the car game up yet, 
started working on a new level for Tomato Antics, and not got round to it yet. 
I will try knock up a couple of test engines soon and post them up :) 

Chris Pile [EMAIL PROTECTED] wrote: CA  - Original Message - 
CA  From: Calvin Allett 
CA  To: 
CA  Sent: Sunday, May 20, 2007 10:41 AM
CA  Subject: RE: Car game


CA  ... Surprised more MC`ers don`t have a dabble with Basic more often tbh :D


Well you know what they say - when you've driven a *Ferrari you really don't 
want to go back
to a Morris Minor!  ;-)






*Not that I've ever driven a Ferrari - but you get the idea!  ;-)

Chris.



   
-
 Yahoo! Answers - Get better answers from someone who knows. Tryit now.

Re: Car game

2007-05-21 Thread Chris Pile
CA  - Original Message - 
CA  From: Calvin Allett [EMAIL PROTECTED]
CA  To: sam-users@nvg.ntnu.no
CA  Sent: Sunday, May 20, 2007 10:41 AM
CA  Subject: RE: Car game


CA  ... Surprised more MC`ers don`t have a dabble with Basic more often tbh :D


Well you know what they say - when you've driven a *Ferrari you really don't 
want to go back
to a Morris Minor!  ;-)






*Not that I've ever driven a Ferrari - but you get the idea!  ;-)

Chris.



RE: Car game

2007-05-20 Thread Calvin Allett
Just a quick message, as I`m a bit/loads hungover after three days on the cider 
:( hehe

Sorry you had so much trouble posting Adrian, I didn`t mean
to ask so much, or to go into so much detail about what I had
been envisioning possible with Basic, so thanks again
for replying so fully, I appreciate it :)

I`ll just say for now that I like your idea`s about how to control the
computer controlled car`s, I`ve never written a car game, even on
the Amiga, so it`s something that I`m coming to completely anew,
and even with the main player control, I`m pretty certain that things
can become complicated (or rather not complicated, but need a
lot of code, so slow) and so I`ve been thinking perhaps along the
wrong road (sorry, very droll :) ) I love the idea of splitting the map into
sections, and having that section `tell` the CPU cars what to do
with regards to speediing up, slowing down etc, I hadn`t thought of
that, and think that would be a very good (and quick) way of achieving
a good compromise.

I`ll honestly try and get some temporary graphics knocked up later, and 
something of a test engine by tonight, just so this is going somewhere, and
not just idle chat :)

Reply fully later as there`s points I want to ask about/ comment on !

Oh, and thanks for including your example in Basic, it`s lovely to have
an example `handed to you on a plate` so to speak, as when MC examples
are used, it`s nice to see another bit of code to try and understand, but when 
your not familar etc etc... Surprised more MC`ers don`t have a dabble with
Basic more often tbh :D

anyways, must SLEEP *_+

Calvin...
 
Adrian Brown [EMAIL PROTECTED] wrote: Yer - but not the message i sent before 
- hang on ill try in plain text at the bottom of this.  This was a reply to 
Calvin

Ok, 1st thing, the advantage of using 2 screens is it doesn’t matter how long 
it takes to redraw the screen you will never see any flickering / shearing etc 
as its not being displayed until its ready, so even if the game runs in a 
frame, i would still use 2 screens, it saves alot of headaches 

Black track would mean clearing the sprites was quicker and you wouldn’t need 
to store a mask, but then you wouldn’t be able to go near the edges of the 
track either.  Afraid the black below the cars (well if the cars have 8 
rotation angles – it would need to be aaround them) would work, if you had 2 
cars near each other one would rub out hte other.

Id have to check my timings again, im not sure if unrolling sprites is quicker 
than compiled sprites.  The disadvantage with compiled sprites is clipping them 
to the edge of screens.  (BTW – Did anyone come up with good ways of doing 
this?  I had ways to easily clip to either left/right or top/bottom, depending 
on which way i stored the sprites, but all 4 was a nightmare).   From memory 
though, compiled sprites are quickest, but use the most memory.  You can have a 
generic sprite drawer for specific sized sprites and make it faster than any 
size.  Loading them all wouldn’t be that much of a problem, even a basic sam 
has 256k which can easily store uncompressed sprites.

A slow part of a car game is the computer drivers, there are various ways to 
make them move around the track, i wrote a system where i split the screen up 
into areas and each area told the AI what direction and speed it was ment to be 
going.  That way i could store a table of direction / speed and then, say i 
split the screen up into 16x16 pixel areas, i would take the AI car x and y, 
divide by 16 and read the speed, direction from the table

1000 Let CarAI1X = 100, CarAI1Y = 100;
1010 Let Dir = Peek(DirTableStart + (CarAI1X / 16) + ((CarAI1Y / 16) * (256/16))
1020 Let Speed = Peek(SpeedTableStart + (CarAI1X / 16) + ((CarAI1Y / 16) * 
(256/16))

Then you can just move the direction and speed towards those values.  If you 
want them to take into account other cars then its alittle harder.  (The 
*256/16) is because for each Y step down the table we have a 256/16 X values to 
skip over.

Collision is always a pain, i would probably just do some sort of box 
collision, then its a case of checking if car1X+CarWidth  car2X and car1X  
car2X+CarWidth (and a similar check of Y) you have a collision, although to be 
kind you would reduce the size of the cars so they could overlap a little, 
especially if you have rotating cars.   There are lots of other ways though.

Ive just been digging up some articles i wrote years ago for a friend on 
learning to program the Z80, ill dust them off and check them over then 
hopefully Mr Colin ‘Mayhem’ Piggot will print them up into Sam Revival.  
Hes just sent me a backup of the code i had started in there, so ill get that 
finished off as well.

Anyway, hope that gives you some help.

Adrian
 




APB Computer Services Ltd. Registered Address: 3 Springfield, Trevadlock, 
Congdons Shop, Launceston, Cornwall, PL15 7PW.  Registration Number: 4942193.  
V.A.T. No: 826 0005 70 

This email and any