English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 08 May 2020, 18:28   #1
Bren McGuire
Registered User
 
Bren McGuire's Avatar
 
Join Date: Nov 2019
Location: Croydon
Posts: 580
How do you build a level?

I am a total newbie but I want to try to make something for Amiga using Blitz Basic (so please go easy on me and don't numb my mind with super techie Amiga stuff in asembler or I'll lose motivation before I even start ).

I do not understand how you build a level in an Amiga.
Let's say what I want to make would be a horizontally-scrolling game. Absolutely no vertical scrolling whatsoever.
A good example of what I'd like to achieve would be like in the game Paramax:
[ Show youtube player ]
(ignore the parallax)

How would you go at this? How are levels usually built? I know the Amiga is not a "tile based" computer like games consoles, but I still have seen tilesets been shown for Amiga games.

Explain it to me like if I was 1 (in coding years, I am).

I have some coding proficiency, I have done stuff in LUA. But I don't understand how you build a level in an Amiga.

Thank you!
Bren McGuire is offline  
Old 08 May 2020, 18:49   #2
Galahad/FLT
Going nowhere
 
Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 8,986
Ok, so, Amiga isn't tile based, but due to how the blitter works, most programmers choose graphics that are 16x16 pixel sized blocks.

So right off the bat, that's how you need to get your head around how the graphics are made up.

To create a level, you need to create a table, and in that table will be held the details of which graphic block is needed to be written.

So in Assembler you might have a table like this:

Assuming the width of the screen is 320 pixels, this means you can have 20 16x16 pixel blocks across on one screen.

So logically your table will have 20 entries for width

If we assume you're using 256 as your height, then again 256 / 16 = 16

So that is 16 16x16 pixel blocks in height, so you now have your table definitions, it will have 20 entries width for each 16x16 block, and it will have a height of 16 entries for each 16x16 block




Level1:
dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2
dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2
dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2
dc.w 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2
dc.w 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1

Sky = 0
Grass=1
Wall=2

So that table there represents 1 screen. If you notice at the bottom there is a row of 1's, this is to denote that you want your routine to write
a 16x16 block using graphic block #1 which in this case is Grass. All of the 0's are to write graphic block 0 which = Sky, and obviously 2= wall.

So the top left value in the table = first 16x16 block in the top left corner of your physical screen or double buffer screen.
The bottom right value in the table = the last 16x16 block in the bottom right corner of your physical screen or double buffer screen.

You would start from the top left corner of the table, check which graphic block the table says to write (in this case 0 = sky), and you would write that block to the screen.
You would then advance right through the table to the next entry, you would add 2 to your screen position and repeat.

and that at its most simplest is how you write a level to appear onscreen.

That table is obviously only any good for a single screen game.

If you wanted your table to account for a horizontally scrolling game, then you would expand the entries from 20 to whatever number of blocks you needed to comprise your level.

Obviously you would only ever need to draw what was physically being displayed on screen, plus what you were going to draw in the hidden border so you don't see the blocks been drawn, and as you scroll, then you would move in the table to get more information.

You would never do this by hand, you would always write a map editor or use an existing one as building level can take a long time.

What that table shows is what graphic blocks need to be written, but that same table might also hold collision details, or changes in terrain of blocks (ice for instance), this is just a basic outline of what you would need to get graphics onto the screen and displayed like a game level might look like.

Last edited by Galahad/FLT; 08 May 2020 at 18:58.
Galahad/FLT is offline  
Old 08 May 2020, 20:41   #3
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
If you're thinking about using Blitz Basic, it actually comes with a simple-but-functional level editor that lets you build up tables like those described above and export them as source, so that's one step you don't need to worry about at least.
Daedalus is offline  
Old 15 May 2020, 21:12   #4
Alpha One
Registered User
 
Alpha One's Avatar
 
Join Date: Jun 2011
Location: Ger
Posts: 223
Here is a nice editor for using tiled based games ...
https://www.mapeditor.org
It can export the levels in various formats.
Alpha One is online now  
Old 28 May 2020, 07:48   #5
OmegaMax
Knight Of The Kingdom
 
OmegaMax's Avatar
 
Join Date: Feb 2016
Location: It's a bald world!
Posts: 179
If what Galahad explained is to difficult for you and it might be because you have no game programming experience then look into Love2d.The forums and open source games from beginners will help you understand game programming.

https://love2d.org/
OmegaMax is offline  
Old 07 June 2020, 17:45   #6
Bren McGuire
Registered User
 
Bren McGuire's Avatar
 
Join Date: Nov 2019
Location: Croydon
Posts: 580
Thanks for all replied. Yes the assembler stuff went over my head, this is why I said I didn't want to read about that because it's very deotivating. I will look into this after I manage to repair my A500
Bren McGuire 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
Wizzy's Quest (PD) Level codes - and [Request] for Level editor Dan support.Games 30 25 August 2023 00:30
New build N-Ed support.Hardware 8 05 May 2012 19:29
Build-It Asle HOL data problems 2 29 November 2009 03:08
I'm stuck on the final level (level 3) of Ghostbusters II. Ironclaw support.Games 34 24 October 2007 07:19
Build your own Accelerator Zetr0 AMR suggestions and feedback 3 12 August 2007 00:32

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 07:19.

Top

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