MaxCoderz

for your 1 bit pleasure!

All times are UTC




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 58 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
 Post subject: [Calc Wars] Inspired.
PostPosted: Fri 06 May, 2005 4:08 pm 
Offline
Maxcoderz Staff

Joined: Sat 18 Dec, 2004 3:51 am
Posts: 1477
Location: Toledo, Ohio, USA
Quite simply, I've been inspired....

Anyways, anyone wanna help, calc wars is gonna be open source... i guess... Basically I'm gonna release the code and algorithms here, I'll do my best to code, and us maxcoderz people can work together to debug and stuff, no?

Anyways.... here's my first algorithm... I asked for debugging earlier, and I ask for reaction to it now....

Code:
;//Routines for tilemapping, by Patori

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Before doing anything, I think that it'd be best to plan
;ahead. hehehe. So anyways, I believe I should discuss the
;program structure, nyo? Ok:
;
;
;   char 'F','L','C','L'
;   byte width,height
;   byte DATA --------------->
;   ------------------------->
;   ------------------------->
;       End, no need for termination bytes, that'd be a waste.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; ///Anyways, the way that the tilemapper would work (or, simply put, it's Algorithm) would be as follows, in poorly written C:
;
;   Variables:
;      width = the map's width
;      height = the map's height
;      xentry = xposition to draw from
;      yentry = yposition to draw from
;      bytetostart = pointer to where to start drawing from
;      MAR = Random Access Memory (Level data)
;      tempy = temporary y value
;      function drawsprite(x pos, y pos, sprite num) = self explanitory
;
;   int tileMap(int width, int height,int xentry, int yentry)
;   {
;      //To calculate the max y.... height-4
;      int bytetostart;
;      if (yentry > (height-4))
;      {
;         tempy = height-4;
;      }
;      else
;      {
;         tempy = yentry;
;      }
;      if (yentry < 0)
;      {
;         yentry = 0;
;      }
;      if (xentry < 0)
;      {
;         bytetostart = (yentry*width);
;      }
;      if (xentry > (width-4))
;      {
;         bytetostart = (yentry*width) + (width-4);
;      }
;      if ((xentry < (width-4)) && (xentry > 0))
;      {
;         bytetostart = (yentry*width) + xentry;
;      }
;      //We are pretending that the RAM is a big array called MAR...
;      //FIX THIS
;      for (int y = 0; y < 4; y++)
;         for (int x = 0; x < 4; x++)
;            drawSprite((x*16),(y*16),MAR[bytetostart+(y*width)+x]);
;      return 0;
;   }
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;


Many thanks! Oh and tr1p? That computer actually works :-P... so I got a coding machine...

_________________
Currently coming up with a new signature idea... since my forum avatar changer was killed by an upgrade...


Last edited by Patori on Fri 06 May, 2005 4:30 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Fri 06 May, 2005 4:13 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 4094
Location: I cant seem to get out of this cryogenic chamber!
OK, this shouldnt be a problem to code ... 16x16 tiles huh ... is this for grayscale?

And you got'sa coding machine ... sweet! :).

EDIT - OK i just read that it is for grayscale :).

_________________
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image


Last edited by tr1p1ea on Fri 06 May, 2005 4:16 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Fri 06 May, 2005 4:16 pm 
Offline
Maxcoderz Staff

Joined: Sat 18 Dec, 2004 3:51 am
Posts: 1477
Location: Toledo, Ohio, USA
don't worry about coding it... STOP. STOP. I SAID DON'T CODE IT <PICTURES TR1P CODING>

NONONONONONONO! I'll do the coding... I just want to know if my algoithm is ok right now.... I will defenitly have this coded by tonight.... Thanks anyways...

:D I don't like making others work hard on my project...

_________________
Currently coming up with a new signature idea... since my forum avatar changer was killed by an upgrade...


Top
 Profile  
 
 Post subject:
PostPosted: Fri 06 May, 2005 4:18 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 4094
Location: I cant seem to get out of this cryogenic chamber!
OK, rofl i *just* picked up by reading he other thread that you just want to make sure your algorithms work :). Luckily as i was about to start coding away.

Anyway, i know what you mean ... this is your project ... besides i dont think you need any help in the coding department anyway :).

_________________
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image


Last edited by tr1p1ea on Fri 06 May, 2005 4:23 pm, edited 2 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Fri 06 May, 2005 4:22 pm 
Offline
Maxcoderz Staff

Joined: Sat 18 Dec, 2004 3:51 am
Posts: 1477
Location: Toledo, Ohio, USA
Yeah... I've went a loonnnng way... anyways... I got to submit a lot or things to ticalc.org I've made.... oh well...

_________________
Currently coming up with a new signature idea... since my forum avatar changer was killed by an upgrade...


Top
 Profile  
 
 Post subject:
PostPosted: Fri 06 May, 2005 4:24 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 4094
Location: I cant seem to get out of this cryogenic chamber!
OK i take it that this line:
Code:
bytetostart = (yentry*width) + width;

Is meant to be:
Code:
bytetostart = (yentry*width) + xentry;

?

Also will the sprite routine take a pointer to the actualy tiledata itself or will it take a tilenumber from the level data and find the tile itself? (I dont see anything that refers to tiledata in there).

_________________
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image


Top
 Profile  
 
 Post subject:
PostPosted: Fri 06 May, 2005 4:29 pm 
Offline
Maxcoderz Staff

Joined: Sat 18 Dec, 2004 3:51 am
Posts: 1477
Location: Toledo, Ohio, USA
Yeah, thanks tr1p... algorithm is changed...

_________________
Currently coming up with a new signature idea... since my forum avatar changer was killed by an upgrade...


Top
 Profile  
 
 Post subject:
PostPosted: Fri 06 May, 2005 4:32 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 4094
Location: I cant seem to get out of this cryogenic chamber!
I was just wondering about the sprite routine ... Will it take a pointer to the tiledata itself? Or just the number ... because if it only takes the number the sprite routine will have to multiply it by the amount of bytes it takes up in memory them offset the tiledata pointer by that. In this case you would need to multiply it by 16.

_________________
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image


Top
 Profile  
 
 Post subject:
PostPosted: Fri 06 May, 2005 4:38 pm 
Offline
Maxcoderz Staff

Joined: Sat 18 Dec, 2004 3:51 am
Posts: 1477
Location: Toledo, Ohio, USA
oh crap... my drawSprite code is at home.....

Anyways... It takes a byte, then is going to djnz through the sprites to draw it... but there are a few things that are different... Like sprite tiles... they are basically in an array of

Code:
struct Units{
int army; //which army
int type; //type of unit
int hp;   //health
int xpos;
int ypos;
}


and they are scanned through and drawn through masking... :) good ol' AND[/code]

_________________
Currently coming up with a new signature idea... since my forum avatar changer was killed by an upgrade...


Top
 Profile  
 
 Post subject:
PostPosted: Fri 06 May, 2005 4:43 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 4094
Location: I cant seem to get out of this cryogenic chamber!
Ok, cool. Man you really have put a LOT of thought into this project! That is good to know :).

_________________
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image


Top
 Profile  
 
 Post subject:
PostPosted: Fri 06 May, 2005 4:44 pm 
Offline
Maxcoderz Staff

Joined: Sat 18 Dec, 2004 3:51 am
Posts: 1477
Location: Toledo, Ohio, USA
well, I'm definatly gonna finish this thing by the end of the year... I want to do other things, such as my PILM and stuff... but anyways... suggestions? Or should we just call this the "Forum that only people named Patrick visit"?

_________________
Currently coming up with a new signature idea... since my forum avatar changer was killed by an upgrade...


Top
 Profile  
 
 Post subject:
PostPosted: Fri 06 May, 2005 4:48 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 4094
Location: I cant seem to get out of this cryogenic chamber!
... HAHAHA That actually made me laugh out loud irl :).

Well as far as i can tell it seems to be ok. Although are you sure all of the pre-processing is necessary? You will be the only one using the routine so you might be able to leave out the error checking unless you are using it as a means of halting the scrolling?

_________________
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image


Top
 Profile  
 
 Post subject:
PostPosted: Fri 06 May, 2005 4:53 pm 
Offline
Maxcoderz Staff

Joined: Sat 18 Dec, 2004 3:51 am
Posts: 1477
Location: Toledo, Ohio, USA
I am checking whether or not some one decided to scroll off the map :) That could be bad!!! :twisted: happened with my old version...

_________________
Currently coming up with a new signature idea... since my forum avatar changer was killed by an upgrade...


Top
 Profile  
 
 Post subject:
PostPosted: Fri 06 May, 2005 4:57 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 4094
Location: I cant seem to get out of this cryogenic chamber!
Yeah, but wouldnt you check for such a thing when the user goes to scroll, rather than when the map is being drawn?

_________________
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image


Top
 Profile  
 
 Post subject:
PostPosted: Fri 06 May, 2005 5:04 pm 
Offline
Maxcoderz Staff

Joined: Sat 18 Dec, 2004 3:51 am
Posts: 1477
Location: Toledo, Ohio, USA
yeah, that would probably work better... I'll come with a whole new set of algorithms on monday... :)

Yeah, checking everytime the map is drawn would be pointless... wait... isn't this drawn only... OH crap... I remember what I was thinking now....

It doesn't really matter anyways. The map is only drawn during scrolling and attacking... (the attacking is different from the arrow in the GBA versions...) and so, not much processor time would be lost..... <- talk about lazy coding...

_________________
Currently coming up with a new signature idea... since my forum avatar changer was killed by an upgrade...


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 58 posts ]  Go to page 1, 2, 3, 4  Next

All times are UTC


Who is online

Users browsing this forum: Baidu [Spider] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB ® Forum Software © phpBB Group | DVGFX2 by: Matt