User Tag List

Results 1 to 2 of 2

Thread: Collision on far right of map (Last 2 pixels)

  1. #1
    Keese Just registered
    Join Date
    Jan 2018
    0 Post(s)
    0 Thread(s)
    vBActivity - Stats
    vBActivity - Bars
    Lv. Percent

    Collision on far right of map (Last 2 pixels)

    This isn't really a bug but maybe something that perhaps got omitted and overlooked maybe to save a few data bits of space..
    I've been trying and trying to figure out if there is something wrong with my code that would make this "bug" happen but I have not successfully figured out a way to fix it without patching the glitch with an offset of where it reads the data from in the last two pixels of the map.
    Using this Code:
    void F()
    int B=Floor(N[0]/256);
    int A=Floor(N[1]/176);
    //These fors and formula prevent the need to draw all screens and all layers all at once,
    //which would cause massive slowdown.
    //This math eliminates the calling of all screens except for the one Link would be
    //on in relation to N[0], N[1], and the 8 screens around it, for a 9x9 grid of screens.
    for(int X=B-1;X<=B+1;X++)
    for(int Y=A-1;Y<=A+1;Y++)
    int a;int b;int modx;int mody;
    //int modpixelx;int modpixely;

    int S=b+a*16;int LARGEMAP=modx+mody+MAPMODIFIER;//

    bool isSolidScreen(int m,int s,int c,int d)//checks for solid at current (map,screen,x,y) in ZC scrolling down to the quarters.
    int x=c-((s%16)*256)-(N[5]-N[0]);
    int y=d-(Floor(s/16)*176)-(N[7]-N[1]);

    if(x<0 || x>255 || y<0 || y>175) return false;

    int mask=1111b;

    if(x % 16 < 8)
    mask &= 0011b;
    mask &= 1100b;

    if(y % 16 < 8)
    mask &= 0101b;
    mask &= 1010b;

    int ret = Game->GetComboSolid(m,s,ComboAt(x,y)) & mask;
    return (ret!=0);
    void DRAW(int x,int a,int b,int y)
    int C;int D;
    int X=x-C;int Y=y-D;if(LOOP==false&&H()==false){X=0;}if(LOOP==false& &I()==false){Y=0;}
    int z;

    plugging the current X and Y coordinate on the screen in variables C and D, moving the character by whichever means of input by a variable that determines overall coordinate on the map, a "scrolling" functionality can determine and detect solid combos for collision, and a flag and type code of similar nature I use for other things in the scrolling game.
    I posted an example of this years ago on the forums here.

    In my game, I connect several maps together to form a much larger map, and loop the map so when the player hits the edge of the map it just draws and loops back around to the other side like many RPG games with a world map.

    The movement part is a simple if(InputRight)N[0]++ moving his overall coordinate and so on. Then another function called after that detects if the player collided with a solid with isSolidScreen and moves the player back the other direction if so before the screen is drawn so it looks like no movement occured while the game is running.
    In this case when using an overhead view and this style of code the player can walk right through the last few pixels on the far right and south, or in a sideview style view with gravity falls through the floor on the last few pixels after N[0]>4094.
    What I'm saying is that in a normal ZQuest game, the last two pixels out of the 4096 (256 per map x 16 screens) on the X axis are never actually used to detect collision because Link would never go there and would be stopped from going out that far by hitting the edge of the world map. I believe the Y Axis solid bits have the same problem at the southmost couple pixels.
    Is it true that because of this those data bits aren't even in the code to check for isSolid there?

    This isSolidScreen function checks for solid in chunks of 4 pixels so when I use it in conjunction (I wrote a code snippet that if I hover the mouse coordinates over a combo while the game is running it will return a string that says "true" or not to detect for solid combo if isSolidScreen is true on that combo) so it always returns true when I hover over the last combo on the last screen on the easternmost edge of the map and I wrote that function just to see if it would return true there or not, yet my character still falls through the floor without the additional patch to offset the detection if N[0] (the main X overall coordinate) > 4094.

    The function SCR( just has to do with where the player is on the screen, his current screen being pre-determined by the F() function indice, and from there coordinates in relation to combos and other objects are determined and plugged into isSolidScreen and other functions for type and flag.
    the Draw( function draws the screens inside of a function similar to F() that determines the screen and map in relation to N[0] and N[1]
    In a future release could you guys check to see if what I'm saying here is right and write in the databits for collision for the last two easternmost pixels please?

    If you (specifically the ZC devs mainly though) want an example quest of this if you message me I'll upload it somewhere and send you link via message PM here because although I'm planning on publishing the game probably unpassworded (I read that there are ways around passwords now anyway) eventually I don't want to do that until it is done so people can play it without looking at the code for spoilers first later on.
    Last edited by Downloader; 04-29-2020 at 01:37 AM.

  2. #2
    Gel Just registered
    Join Date
    Aug 2020
    0 Post(s)
    0 Thread(s)
    vBActivity - Stats
    vBActivity - Bars
    Lv. Percent
    I think bugs are a normal part of every game, it's great that users like you try to help!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.