Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
19 June, 2013, 11:12:23 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: [1] 2   Go Down
  Print  
Author Topic: Tilemapping in Axe -  (Read 1068 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
zeldaking
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: 05 June, 2013, 20:18:14
Date Registered: 31 July, 2011, 20:02:13
Posts: 153

Topic starter
Total Post Ratings: +14

View Profile
« on: 02 August, 2011, 19:39:46 »
0

I know there are specific tutorials out there for tilemapping in axe, but they don't help if you can't ask questions about them. I am trying to learn tilemapping, but it is pretty confusing. Can someone give a small example and we can go from there?
Logged
yunhua98
You won't this read sentence right.
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: 14 May, 2012, 03:06:37
Date Registered: 26 May, 2010, 22:58:45
Location: Somewhere in Deep Space.
Posts: 2717


Total Post Ratings: +199

View Profile
« Reply #1 on: 02 August, 2011, 20:26:24 »
0

Do you want smooth scrolling?
I can write a simple example.  Wink
Logged


Spoiler for =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.

On hold for Contest.


Spoiler for ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11

zeldaking
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: 05 June, 2013, 20:18:14
Date Registered: 31 July, 2011, 20:02:13
Posts: 153

Topic starter
Total Post Ratings: +14

View Profile
« Reply #2 on: 02 August, 2011, 20:28:38 »
0

Well considering I understand that part, sure. Nothing to complicated (hint: 1 or 2 character sprites)
Logged
yunhua98
You won't this read sentence right.
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: 14 May, 2012, 03:06:37
Date Registered: 26 May, 2010, 22:58:45
Location: Somewhere in Deep Space.
Posts: 2717


Total Post Ratings: +199

View Profile
« Reply #3 on: 02 August, 2011, 20:46:05 »
0

For in-depth explanations of any of this code or questions or bugs (I haven't tested this. Tongue), just post'em.  Wink


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
:.TILEMAP
:[0000000000000000]->Pic0
:[FFFFFFFFFFFFFFFF]
:
:[010101010101010101010101010101010101010101010101]→GDB1
:[010101010101010101010101010101010101010101010101]
:[010101010101010101010101010101010101010101010101]
:[010101010101010101010101010101010101010101010101]
:[010101010100000000000000000000000000000101010101]
:[010101010100000000000000000000000000000101010101]
:[010101010100000000000000000000000000000101010101]
:[010101010100000000000000000000000000000101010101]
:[010101010100000000000000000000000000000101010101]
:[010101010100000000000000000000000000000101010101]
:[010101010100000000000000000000000000000101010101]
:[010101010100000000000000000000000000000101010101]
:[010101010100000000000000000000000000000101010101]
:[010101010100000000000000000000000000000101010101]
:[010101010100000000000000000000000000000101010101]
:[010101010100000000000000000000000000000101010101]
:[010101010100000000000000000000000000000101010101]
:[010101010100000000000000000000000000000101010101]
:[010101010101010101010101010101010101010101010101]
:[010101010101010101010101010101010101010101010101]
:[010101010101010101010101010101010101010101010101]
:
:0->P->Q  \\P and Q are the coordinates of the corner of the screen relative to the entire chunk of level data
:
:Repeat getKey(15)
:
:getKey(3)-getKey(2)+P->P
:getKey(1)-getKey(4)+Q->Q  \\I didn't code in collision detection, if you need that too, tell me
:
:sub(MAP)
:
:Pt-On(40,24,(your sprite here)
:
:DispGraph
:
:End
:
:Lbl MAP
:ClrDraw
:For(B,0,7)
:For(A,0,11)
:Pt-On(8*A,8*B,{Q+B*24+P+A+GDB1}*8+Pic0
:End
:End
Logged


Spoiler for =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.

On hold for Contest.


Spoiler for ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11

zeldaking
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: 05 June, 2013, 20:18:14
Date Registered: 31 July, 2011, 20:02:13
Posts: 153

Topic starter
Total Post Ratings: +14

View Profile
« Reply #4 on: 02 August, 2011, 20:49:17 »
0

Thanks, that is exactly what I need to get started.
for the map drawing .sub(map. is it A*8 because of 8x8 tiles? Also what is {Q+B*24+P+A+GDB1} can you give me answer in depth?
« Last Edit: 02 August, 2011, 20:52:27 by zeldaking » Logged
chattahippie
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 27 March, 2013, 05:21:38
Date Registered: 19 July, 2011, 04:13:49
Location: Somewhere
Posts: 358


Total Post Ratings: +27

View Profile
« Reply #5 on: 02 August, 2011, 21:46:53 »
0

Thanks, that is exactly what I need to get started.
for the map drawing .sub(map. is it A*8 because of 8x8 tiles? Also what is {Q+B*24+P+A+GDB1} can you give me answer in depth?

I think it just locates the data located in a specific point of GBD1, so that only the data needed is displayed on the screen, and not the entire GBD1, if I'm not mistaken.

I say this because I know the {} mean to load a point in data, and it has the pointer for the data, GBD1, which says that it loads from a point inside GBD1.

I'm sure yunhua will correct me if I'm wrong, but that is my answer
Logged
yunhua98
You won't this read sentence right.
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: 14 May, 2012, 03:06:37
Date Registered: 26 May, 2010, 22:58:45
Location: Somewhere in Deep Space.
Posts: 2717


Total Post Ratings: +199

View Profile
« Reply #6 on: 02 August, 2011, 22:03:12 »
0

What he said.
the A*8 is indeed because of the 8x8 tiles, and in {Q+B*24+P+A+GDB1}, Q+B*24 is interpreted as (Q+B)*24 because of left to right order of operations.  The width of the map is 24, so to get to the next row, you add 24, in this case, you add Q+B number of rows.  Add one to go one byte to the right, so P and A are added, plus the original pointer, GDB1.
Logged


Spoiler for =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.

On hold for Contest.


Spoiler for ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11

chattahippie
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 27 March, 2013, 05:21:38
Date Registered: 19 July, 2011, 04:13:49
Location: Somewhere
Posts: 358


Total Post Ratings: +27

View Profile
« Reply #7 on: 02 August, 2011, 22:10:29 »
0

What he said.

Grin Woot! I figured it out!
Logged
LincolnB
Check It Out Now
LV9 Veteran (Next: 1337)
*********
Offline Offline

Gender: Male
Last Login: 20 May, 2013, 05:36:22
Date Registered: 02 May, 2011, 00:56:28
Location: Utah Valley
Posts: 1114


Total Post Ratings: +121

View Profile
« Reply #8 on: 03 August, 2011, 01:21:44 »
0

also, if it clarifies anything, given an array GDB1 with n number of columns, you can access the yth element down and the xth element over via the following formula:

{y*n+x+GDB1}

keep in mind this returns one byte, a value between 0 and 255. to do other things like access nibbles and two-byte integers (between 0 and 65,535) it gets slightly more complicated, but retains the same idea.

Logged

Completed Projects:
   >> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
   >> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.


Spoiler for Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)


chattahippie
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 27 March, 2013, 05:21:38
Date Registered: 19 July, 2011, 04:13:49
Location: Somewhere
Posts: 358


Total Post Ratings: +27

View Profile
« Reply #9 on: 03 August, 2011, 04:17:10 »
0

also, if it clarifies anything, given an array GDB1 with n number of columns, you can access the yth element down and the xth element over via the following formula:

{y*n+x+GDB1}

keep in mind this returns one byte, a value between 0 and 255. to do other things like access nibbles and two-byte integers (between 0 and 65,535) it gets slightly more complicated, but retains the same idea.



But 256 tiles is a lot of sprites to choose from, and I can't think of many, if any, projects that use anywhere near 65,536 sprites, although I would love to see such a behemoth project that uses all of them!
That would be monstrous Cheesy
Logged
LincolnB
Check It Out Now
LV9 Veteran (Next: 1337)
*********
Offline Offline

Gender: Male
Last Login: 20 May, 2013, 05:36:22
Date Registered: 02 May, 2011, 00:56:28
Location: Utah Valley
Posts: 1114


Total Post Ratings: +121

View Profile
« Reply #10 on: 05 August, 2011, 01:23:35 »
0

right, that would be pretty epic Smiley but hard to do it well in a game, and not make it look like you just crammed as many tiles as you could without considering actual content
Logged

Completed Projects:
   >> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
   >> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.


Spoiler for Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)


Eiyeron
LV7 Elite (Next: 700)
*******
Offline Offline

Gender: Male
Last Login: 07 January, 2013, 20:29:04
Date Registered: 09 August, 2011, 16:51:22
Location: Err 404.
Posts: 552


Total Post Ratings: +18

View Profile WWW
« Reply #11 on: 14 August, 2011, 19:57:36 »
0

What he said.
the A*8 is indeed because of the 8x8 tiles, and in {Q+B*24+P+A+GDB1}, Q+B*24 is interpreted as (Q+B)*24 because of left to right order of operations.  The width of the map is 24, so to get to the next row, you add 24, in this case, you add Q+B number of rows.  Add one to go one byte to the right, so P and A are added, plus the original pointer, GDB1.

Hem... Is it normal? IRL, or in C, the * operaotr has more priotiy than +...
Logged




zeldaking
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: 05 June, 2013, 20:18:14
Date Registered: 31 July, 2011, 20:02:13
Posts: 153

Topic starter
Total Post Ratings: +14

View Profile
« Reply #12 on: 14 August, 2011, 19:58:51 »
0

Well, I am making a game with about 160 grayscale sprites (called condor) and I think it isn't too hard.
Logged
Eiyeron
LV7 Elite (Next: 700)
*******
Offline Offline

Gender: Male
Last Login: 07 January, 2013, 20:29:04
Date Registered: 09 August, 2011, 16:51:22
Location: Err 404.
Posts: 552


Total Post Ratings: +18

View Profile WWW
« Reply #13 on: 14 August, 2011, 20:00:33 »
0

For a C project, i made the references intuitives: In a sokoban, if box = 3 and dot = 2, then box on a dot = 3+2
Logged




Ashbad
Guest
« Reply #14 on: 14 August, 2011, 21:45:32 »
0

What he said.
the A*8 is indeed because of the 8x8 tiles, and in {Q+B*24+P+A+GDB1}, Q+B*24 is interpreted as (Q+B)*24 because of left to right order of operations.  The width of the map is 24, so to get to the next row, you add 24, in this case, you add Q+B number of rows.  Add one to go one byte to the right, so P and A are added, plus the original pointer, GDB1.

Hem... Is it normal? IRL, or in C, the * operaotr has more priotiy than +...

In Axe, yes it's normal, since that's how math is defined in it.
Logged
Pages: [1] 2   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.416 seconds with 30 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.