English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 13 October 2019, 21:47   #1
deimos
Registered User

 
Join Date: Jul 2018
Location: Londonish / UK
Posts: 489
Can I write a game in 3 weeks?

For the next 3 weeks I'm cat sitting in the middle of the countryside. I've decided to see if I can complete something that resembles a game in that time. I won't be starting completely from scratch as I have various bits already working and I only have a few chores I have to do each day, so can spend a solid chunk of time coding, maybe equivalent to a full working day.

I thought it might make it more fun if I kept this thread up to date with my progress, and to allow anyone who wants to chip in with help and encouragement to do so here. If I have really specific technical questions I'll create separate threads and link back to keep this thread more approachable.

I'm aiming to write a flight simulator along the lines of F/A 18 Interceptor, though the 3 weeks I have means I'll be happy if I can fly around, shoot missiles, look around from inside and outside the plane and crash into the ground.

I'm starting with a bunch of mostly interrupt handling code, giving me keyboard reading, triple buffer display and a blitter queue (currently limited to clearing the screen and drawing lines). I also have a separate bunch of code that I wrote last year (http://eab.abime.net/showthread.php?t=93740&page=7) that does a lot of 3D, including drawing a model jet fighter using a hard coded BSP tree.

Preliminary plan, I'm changing the stars to hyphens as I complete tasks.

Progress so far, Day 0

- Set up PC
- Order a longer network cable
- Rework blitter queue to use callbacks
- Rework blitter queue to perform multiple operations from a single queued blit (test code now 24fps, was 18)

Day 1

- Implement polygon fill in blitter queue
- Implement data structures for polygons
- Implement polygon clipping (I may already have this)
- Rework for arbitrary clipping rectangle
- Implement polygon fill
- Scratch area
- XOr line operation
- Fill operation
- Rework line data structures for consistency with polygons
* Write test / benchmark code
- Create a plan for Day 2 and beyond

Day 2

- Revive my 3D transformation code
- Revive my BSP code
- Draw spinning jet on screen
* Draw ground / sky

Day 2.5:

- Add Scratch B and C areas and delete scratch clearing
- Bounding boxes for area fill and blits from scratch

Day 3

* Rework so that the jet is "us", so not visible from inside cockpit
* Add ability to change camera to outside aircraft and to change between split and full screen

Day 4

* Add some instrument panel detail (will need advice from people who have seen inside a modern jet fighter)
* Write code to only redraw instruments when they change their values

Day 5

* Rework models to allow sub-models, i.e. missiles mounted under wings, undercarriage

Day 6

* Implement thrust and acceleration (will need advice on calculations and jet fighter capabilities)

Day 7

* Implement banking / turning (I'll probably need to order a joystick)

Day 8

* Implement missile launching

Day 9

* Basic sound effects, engine noise, missile launch (never done sound before...)

Awesome Idea? Daft idea?

Last edited by deimos; 17 October 2019 at 13:41.
deimos is offline  
Old 13 October 2019, 22:05   #2
malko
Ex nihilo nihil

malko's Avatar
 
Join Date: Oct 2017
Location: CH
Posts: 2,343
I would say it's a crazy but cool idea
Even if I don't play "Flight simulator games", I will follow this thread with interest and hope you will manage to code something interesting within these three weeks !
All the best !
malko is offline  
Old 13 October 2019, 22:35   #3
redblade
Zone Friend

redblade's Avatar
 
Join Date: Mar 2004
Location: Middle Earth
Age: 35
Posts: 1,370
Good luck with the project

Now for some questions:
Is it for Amiga 500 or Amiga 1200?
How many bitplanes is it? What does 8 colours, Interlace look like with your engine?
If running on AGA will it run in other screen modes apart from the NTSC/PAL?
Will it use modern input? (mouse for x,y gradient then keyboard for barrel rolls and thrust)
For your HUD are you using dual playfield or will you just use sprites over the top?

Once again good luck and enjoy your holiday
redblade is offline  
Old 13 October 2019, 23:02   #4
deimos
Registered User

 
Join Date: Jul 2018
Location: Londonish / UK
Posts: 489
Quote:
Originally Posted by redblade View Post
Good luck with the project

Now for some questions:
Is it for Amiga 500 or Amiga 1200?
How many bitplanes is it? What does 8 colours, Interlace look like with your engine?
If running on AGA will it run in other screen modes apart from the NTSC/PAL?
Will it use modern input? (mouse for x,y gradient then keyboard for barrel rolls and thrust)
For your HUD are you using dual playfield or will you just use sprites over the top?

Once again good luck and enjoy your holiday
I'm targeting OCS Amigas, so unexpanded 500s.

Currently planning 16 colours for the main view, 8 for the instrument panel. Main view triple buffered, instrument panel single.

Will be running in PAL mode only initially, but I'll try to keep everything as constants so that can be changed easily. I'm not going to touch anything AGA.

I don't think I'll use the mouse for flight control, I think I joystick is more fun. I am considering how I could use the mouse to make other things more intuitive, such as changing weapons, selecting targets, etc.

For the HUD, I don't think dual playfield would offer any advantage, plus I wouldn't be able to have 16 colours for the main playfield. I have considered sprites, but not decided yet. May not even get that far in the time I have.
deimos is offline  
Old 14 October 2019, 02:24   #5
Shatterhand
Warhasneverbeensomuchfun

Shatterhand's Avatar
 
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 36
Posts: 3,430
All 3 Amiga games I made took me less than 3 weeks to code.

Though none of them were Flight Sims
Shatterhand is offline  
Old 14 October 2019, 10:58   #6
deimos
Registered User

 
Join Date: Jul 2018
Location: Londonish / UK
Posts: 489
I've written up a plan for the first 10 days, but it's on the computer that won't be connected to the internet until the postie comes with my network cable. I'll update my original post when I can to keep the plan up the top.

Today is about 2D polygons and filling them on the screen, starting with clipping them.

EDIT: Network cable arrived, plan has been updated. Today I have implemented polygon clipping and am now working on ONEDOT / XOR line drawing, then filling.

Last edited by deimos; 14 October 2019 at 15:19.
deimos is offline  
Old 14 October 2019, 18:02   #7
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,485
Yes, of course you can write a game in 3 weeks. It depends on the game - I wrote a new one every day on the VIC-20 in 1983.

A working flight-simulator, even a simplistic one, but especially with the features you listed, is quite ambitious in the timeframe given. I see you have some existing code which you can revive or reuse, which might help, but I can guarantee that you will run into serious problems at some point during development, which renders a daily pre-planning quickly obsolete.

Nevertheless, I love your project, and hope you have something to show after some time. The Amiga's 3D-capabilities have aged much more than its scrolling/sprite features, but at least this is something completely different than the usual Jump'n'Runs and Shooters of these days.

Quote:
Originally Posted by deimos View Post
* Add some instrument panel detail (will need advice from people who have seen inside a modern jet fighter)
I'm not a pilot, but I can fly most planes from a Cessna to a 737 in X-Plane 11, so I know which instruments you need and how they look like.

Quote:
* Write code to only redraw instruments when they change their values
Provided the simulation generates useful data for all the instruments.

Quote:
* Implement thrust and acceleration (will need advice on calculations and jet fighter capabilities)
That might become quite complex...

Quote:
* Basic sound effects, engine noise, missile launch (never done sound before...)
Depends whether your game is OS-compliant or takes over the system. It's probably easier when programming the audio hardware directly.
phx is offline  
Old 14 October 2019, 20:17   #8
deimos
Registered User

 
Join Date: Jul 2018
Location: Londonish / UK
Posts: 489
Quote:
Originally Posted by phx View Post
I can guarantee that you will run into serious problems at some point during development, which renders a daily pre-planning quickly obsolete.
Agreed, but I wouldn't know if things were going pear-shaped unless I had a plan to compare to.
deimos is offline  
Old 14 October 2019, 20:43   #9
deimos
Registered User

 
Join Date: Jul 2018
Location: Londonish / UK
Posts: 489
Update, Day 1

I've integrated my polygon clipping code and am blitting the outlines in one-dot / xor mode to a scratch area. This all seems to work (I'm temporarily pointing the bottom half / instrument panel area of my screen to the scratch area so I can verify this).

I'm then blitting in area fill mode to draw the polygons onto the main screen. Typing this message makes me realise that I've only set things up to copy the filled polygon to the main screen, without preserving the background, but even that isn't working. I've posted another thread asking for help on that.

So, there you go, one day in and I'm already behind schedule.

Edit: Got some help from Antiriad and now have polygons. I still need to work out how to keep the background around the polygons, but things are looking better.

Last edited by deimos; 14 October 2019 at 22:19.
deimos is offline  
Old 15 October 2019, 10:33   #10
sandruzzo
Registered User
 
Join Date: Feb 2011
Location: Italy/Rome
Posts: 1,647
Any screen shots?
sandruzzo is offline  
Old 15 October 2019, 10:39   #11
deimos
Registered User

 
Join Date: Jul 2018
Location: Londonish / UK
Posts: 489
Quote:
Originally Posted by sandruzzo View Post
Any screen shots?
Not that you want to see yet.
Attached Thumbnails
Click image for larger version

Name:	broken.png
Views:	151
Size:	15.1 KB
ID:	64768  
deimos is offline  
Old 15 October 2019, 10:40   #12
sandruzzo
Registered User
 
Join Date: Feb 2011
Location: Italy/Rome
Posts: 1,647
Quote:
Originally Posted by deimos View Post
Not that you want to see yet.
As a programmer, I found them allways interesting! Are you going to use pure blitters' filling?
sandruzzo is offline  
Old 15 October 2019, 11:03   #13
deimos
Registered User

 
Join Date: Jul 2018
Location: Londonish / UK
Posts: 489
Quote:
Originally Posted by sandruzzo View Post
As a programmer, I found them allways interesting! Are you going to use pure blitters' filling?
Yes, that's what's not working at the moment. I'm trying to fill a polygon that's been one dot line drawn into my scratch area straight over lines that have already been drawn on my mainscreen buffer. Beginning to think it's not possible and maybe I need an intermediate step, which doesn't feel right.

I have lines like this attachment, that are moving about, and the polygon I'm filling is a big diamond shape that goes over all four edges so is clipped to an octagon. I'm trying to fill the polygon directly over the lines so you should just see the occasional line poking out from behind. But it's currently a mess.

I've been discussing it more over on this thread: http://eab.abime.net/showthread.php?t=99190
Attached Thumbnails
Click image for larger version

Name:	lines-only.png
Views:	93
Size:	11.2 KB
ID:	64769  
deimos is offline  
Old 15 October 2019, 11:10   #14
sandruzzo
Registered User
 
Join Date: Feb 2011
Location: Italy/Rome
Posts: 1,647
What about this tips?

https://scalibq.wordpress.com/2012/0...real-part-5-1/

https://scalibq.wordpress.com/2011/1...t-real-part-5/

https://scalibq.wordpress.com/2011/1...t-real-part-4/

https://scalibq.wordpress.com/2011/1...t-real-part-3/

[ Show youtube player ]
sandruzzo is offline  
Old 15 October 2019, 11:27   #15
deimos
Registered User

 
Join Date: Jul 2018
Location: Londonish / UK
Posts: 489
That implies that you need to fill the polygon and copy it over in two steps, so maybe what I want to do is impossible.
deimos is offline  
Old 15 October 2019, 11:30   #16
sandruzzo
Registered User
 
Join Date: Feb 2011
Location: Italy/Rome
Posts: 1,647
Quote:
Originally Posted by deimos View Post
That implies that you need to fill the polygon and copy it over in two steps, so maybe what I want to do is impossible.
I think filling direct on planes, you should to do line setup with cpu, and do a direct copy D=A with blitter, and use proper if any mask for first and last word.

Disadvantage of this is thta you need one blitting for line.
sandruzzo is offline  
Old 15 October 2019, 13:49   #17
deimos
Registered User

 
Join Date: Jul 2018
Location: Londonish / UK
Posts: 489
In order to progress I've updated my polygon code to fill in the scratch area before blitting sets/clears to each destination bitplane. It doesn't feel right, but at least I can move on.

If this does end up being the preferred approach then I'll have to revisit it as I'm not using any bounding boxes, so I'm blitting far more data than I need to, but that's for later.

Code:
void ClipAndFillPolygon(const ScreenBuffer * screenBuffer, const ScreenBuffer * scratchScreenBuffer,
                        const UWORD n, const Point2D polygon [], const Rectangle2D clipRect, const UWORD colour)
{
    Point2D clippedPolygon[10];
    UWORD c = ClipPolygon2D(clipRect, n, polygon, clippedPolygon);
    for (UWORD i = 0; i < c; i++) {
        Line2D line = {
            clippedPolygon[i],
            clippedPolygon[(i + 1) % c]
        };
        DrawOneDotLine(scratchScreenBuffer, line);
    }
    InPlaceAreaFill(scratchScreenBuffer);
    CopyScratchInColour(screenBuffer, scratchScreenBuffer, colour);
    ClearScratch(scratchScreenBuffer);
}
deimos is offline  
Old 15 October 2019, 16:14   #18
sandruzzo
Registered User
 
Join Date: Feb 2011
Location: Italy/Rome
Posts: 1,647
Here another interesting one, about blitter lines clipping

http://www.schwinde.de/blog/index.php?a=13
sandruzzo is offline  
Old 15 October 2019, 19:21   #19
deimos
Registered User

 
Join Date: Jul 2018
Location: Londonish / UK
Posts: 489
Update, Day 2

Having successfully, though inefficiently, achieved polygon filling, I've moved onto the day 2 tasks (Revive my 3D transformation code / Revive my BSP code / Draw spinning jet on screen). I'm now at the point where I think I've moved all the necessary existing code over from my previous work and updated it to use my blitter routines rather than the CPU based scanline fill I previously had.

If you look very carefully you may be able to make out a small fighter jet!
Attached Thumbnails
Click image for larger version

Name:	jet1.png
Views:	107
Size:	8.2 KB
ID:	64781  

Last edited by deimos; 15 October 2019 at 21:31.
deimos is offline  
Old 15 October 2019, 22:03   #20
deimos
Registered User

 
Join Date: Jul 2018
Location: Londonish / UK
Posts: 489
So, this blitter fill stuff... does it actually work? I mean for actual, real life, not a demo, things like this?

At the moment I think I can see a way to make it work, but it's going to take a lot more than the "just xor the lines and throw away the first bit" explanations that I keep seeing online.
deimos is offline  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
So, I'd like to write a new Amiga game - what do you want to see? Graham Humphrey Amiga scene 88 26 February 2012 22:50
My sales over next couple of weeks emdxxxx MarketPlace 4 31 October 2007 11:17
AmigaSYS 1.7 Released ETA : 1-2 Weeks. Dary News 34 22 March 2005 20:51
HOL mentioned in this weeks Micro Mart fiath Amiga scene 8 07 June 2004 00:56

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 16:57.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Page generated in 0.09633 seconds with 14 queries