OpenBOR Split Screen - Prototype Test

Thats cool, I cant get more than 60fps in openbor here, its capped at 60 not matter what i do, maybe its intel hd 4000 graphics drivers but interesting thing is, i have 200fps on android, but it slows down at exactly the same amount of fglayers on both android and pc, android is octacore 2ghz .LAptop is just dualcore 2.5ghz.
I rarely had issues with fps drops , only when using too many fglayers/bglayers, one fglayer too much and suddenly you have half the fps.

But some things work strange and dont support my claims, for example this doesnt have fps drops at all :
Code:
background    data/bgs/labir.gif

panel        data/bgs/labir.gif




fglayer  data/sprites/mur3.gif  -1580 0 0 -100 -100 200 -1 3 1 1 0 0 0 0 0 0 1

fglayer  data/sprites/mur3.gif  -1380 0 0   250 100 200 -1 3 1 1 0 0 0 0 0 0 1

fglayer  data/sprites/mur3.gif  -1180 0 0 -200 300 -200 -1 3 1 1 0 0 0 0 0 0 1


fglayer  data/sprites/mur3.gif  -980 0 0 250 500 -200 -1 3 1 1 0 0 0 0 0 0 1

fglayer  data/sprites/mur3.gif  -780 0 0 -300 700 200 -1 3 1 1 0 0 0 0 0 0 1

fglayer  data/sprites/mur3.gif  -580 0 0 250 900 200 -1 3 1 1 0 0 0 0 0 0 1

fglayer  data/sprites/mur3.gif  -380 0 0 -500 1100 200 -1 3 1 1 0 0 0 0 0 0 1

fglayer  data/sprites/mur3.gif  -180 0 0 250 1300 -100 -1 2 1 1 0 0 0 0 0 0 1
###################

fglayer  data/sprites/lawb.gif  -1480 0 0 1850 -50 1200 -1 1 1 1 0 0 0 0 0 0 1

fglayer  data/sprites/lawb.gif  -1280 0 0 1405 150 250 -1 1 1 1 0 0 0 0 0 0 1


fglayer  data/sprites/lawb.gif  -1080 0 0 250 350 960 -1 3 1 1 0 0 0 0 0 0 1

fglayer  data/sprites/lawb.gif  -880 0 0 1420 550 800 -1 2 1 1 0 0 0 0 0 0 1



fglayer  data/sprites/lawb.gif  -680 0 0 1420 750 350 -1 2 1 1 0 0 0 0 0 0 1



fglayer  data/sprites/lawb.gif  -480 0 0 1400 950 600 -1 2 1 1 0 0 0 0 0 0 1


fglayer  data/sprites/lawb.gif  -280 0 0 1400 1150 1800 -1 2 1 1 0 0 0 0 0 0 1



#fglayer  data/sprites/lawb.gif  -80 0 0 1440 1350 800 -1 1 1 1







fglayer data/bgs/fogub.gif 1 1 1 -100 -150 0 0 -1 1 1 1


But this does :
Code:
panel        data/bgs/spik1.GIF



bglayer data/bgs/water.gif  1 1 -110 -10 0 0 2 1 1 1 4 35 55 0.8

fglayer data/bgs/ray.gif 1 -0.3 -0.4 110 0 320 0 -1 1 1 3

fglayer data/bgs/half.gif 1 -0.6 -0.3 0 410 0 0 -1 1 1

I suspect that when fglayer/bglayer is moving one, then fps drops more, on that first example these are non moving fglayers.SEcond examples are fglayers that move in parallax or water effect.

BTW for screen merging when characters are close - vertical split screen could work better, there are some games that do use horizontal split but these are mostly fps /racing games where wide FOV is desirable, also there was this old game on amiga /atari called alcatraz that had horizontal split screen , i also remember spy vs spy game that had it, lemmings on amiga as well.
Anyway i dont want to derail this by blabbing about fglayers and stuff, your split screen code works nice.
 
Last edited:
In this video I'm showing some progress of the Split Screen code. Now it works in a vertical orientation and changes dynamically according to the player's position.

The code is not ready to use yet because it needs more tests and some optimizations, but at least we can see that it's perfectly possible. I will continue working on it and posting new updates gradually.

 
Congratulations for this fantastic job. Your skills on scripting never cease to amaze me 😊. That's a really cool feature for a 2 players game. I can't wait to try a demo.
 
In this video I'm showing some progress of the Split Screen code. Now it works in a vertical orientation and changes dynamically according to the player's position.

The code is not ready to use yet because it needs more tests and some optimizations, but at least we can see that it's perfectly possible. I will continue working on it and posting new updates gradually.

WOAW crazy you already made it !!! You are so fast !!! Thanks a lot :love:
 
I was going to suggest a border, but looks like you already thought of it. I also really like how the split screen effect turns off when players are in the same area. That's a very nice touch.

DC
Thanks man :)

Yeah, the most complex part of the code was the one that connects the two screens into one smoothly. I still need to improve this feature at the beginning and at the end of the level which sometimes changes abruptly, like at 0:17 in the video.
 
This is really fantastic dear friend! 😳
It looks really amazing! 🤩

The possibilities that open up to use this are endless. 🤗

Thank you very much for this great contribution and congratulations for your great work my friend! 🤜🤛
 
@bWWd & @Kratus

Split screen games in the 16 bit era are very rare, but very cool.

vertical split screen might be best for openbor projects, since it allows for less stuff to be rendered on the screens.

I think that its why Dragon ball z games chose to go that route, to avoid slow-downs & such.

as for 3D modules using split screen methods, i have found that vertical split screen works best for capture cards, the way digital video is recorded (from top to bottom) messes up with the bottom screen a lot if the 3D game is horizontal (bottom image gets captured later than top images, so you get a bottom screen lag/desync from time to time)
 
In this video I'm showing a good progress of the Split Screen code. Now we can add front and back layers with different speeds, plus now both screens will connect more smoothly than before.

The code is more organized, but needs some optimizations yet.
The tests were made by using "fglayers" only, but can work with others too.

EDIT: A few more explanations about the code.

- The fglayer properties "ratio" and "z" are loaded directly from the level file properties, but needs to be correctly adjusted according to the level
- Until I develop a better way to do it, every new "fglayer" needs to be added in both level file and the script file
- The "panel" and "playable area" doesn't need any adjustment in case you add more fglayers
- If I remember more tips, I will post them here. Any questions or suggestions, please post here too.


C:
void main()
{
    if(openborvariant("in_titlescreen")){
        clearglobalvar();
        clearlocalvar();
    }

    if(openborvariant("in_level")){
        if(!openborvariant("pause")){
            splitScreen(0, 1);
            splitScreen(1, 1);
            normalScreen(2);
            clearspriteq();
        }
    }
}

void splitScreen(int player, int type)
{//Simulates a "split screen" feature (Kratus 02-2022)
 //Don't forget to set a "wait" in "at 0" on every level to lock the "xpos" scrolling to avoid screen "shaking"
 //Most things on the game will need to be scripted, once most native functions will not work in the level design

    void ent = getplayerproperty(player, "entity");
   
    //HORIZONTAL
    if(type == 0){
        if(ent){
            void vScreen    = openborvariant("vscreen");
            float x            = getentityproperty(ent, "x");
            float z            = getentityproperty(ent, "z");
            float hRes        = openborvariant("hresolution");
            float vRes        = openborvariant("vresolution");
            float xPos        = openborvariant("xpos");
            float yPos        = openborvariant("ypos");
            float minZ        = openborvariant("PLAYER_MIN_Z");
            float maxZ        = openborvariant("PLAYER_MAX_Z");
            float screenDif    = (vRes/2)*player;
            float scaleX    = 256;
            float scaleY    = 256;
            float zAdd        = 500;
            float xVel        = 1;
            float zVel        = 1;

            //START AND DEFINE VARIABLES
            if(getglobalvar("screenP"+player) == NULL()){
                changeopenborvariant("viewportx", 0);
                changeopenborvariant("viewporty", 0);
                changeopenborvariant("viewportw", openborvariant("levelwidth"));
                changeopenborvariant("viewporth", openborvariant("levelheight"));
                changeentityproperty(ent, "position", xPos+(hRes/6), minZ+(screenDif/8));
                setglobalvar("xOffset"+player, 0);
                setglobalvar("zOffset"+player, 0);
                setglobalvar("screenP"+player, allocscreen(openborvariant("levelwidth"), vRes));
            }

            //READJUST SCREENS FOR 1 OR TWO PLAYERS IN REAL TIME
            //DISABLED BECAUSE NEED IMPROVEMENTS
            if(openborvariant("count_players") <= 1){
                // scaleX = 512;
                // scaleY = 512;
                // hRes = hRes/2;
                // screenDif = 0;
            }
           
            //CLEAR SCREEN
            clearscreen(getglobalvar("screenP"+player));

            //ADJUST LEVEL OFFSET AS A "FAKE" XPOS FOR EACH SCREEN IN REAL TIME
            //USED WHEN THE CHARACTER IS MOVED TO RIGHT DIRECTION IN REAL TIME
            if(x + getglobalvar("xOffset"+player) > (hRes/2)){
                if(getglobalvar("xOffset"+player) > (hRes-openborvariant("levelwidth"))){
                    setglobalvar("xOffset"+player, getglobalvar("xOffset"+player)-xVel);
                    changeentityproperty(ent, "subject_to_screen", 0);
                }
            }
           
            //USED WHEN THE CHARACTER IS MOVED TO LEFT DIRECTION IN REAL TIME
            //DISABLED TO WORK ONLY FOR THE RIGHT DIRECTION, BUT THE LEFT DIRECTION WORKS CORRETLY TOO
            if(x + getglobalvar("xOffset"+player) < (hRes/2)){
                if(getglobalvar("xOffset"+player) < 0){
                    setglobalvar("xOffset"+player, getglobalvar("xOffset"+player)+xVel);
                    changeentityproperty(ent, "subject_to_screen", 0);
                }
                else
                {
                    changeentityproperty(ent, "subject_to_screen", 1);
                }
            }

            //ADJUST LEVEL OFFSET AS A "FAKE" XPOS FOR EACH SCREEN IN REAL TIME
            //USED WHEN THE CHARACTER IS MOVED TO RIGHT DIRECTION IN REAL TIME
            if(z + getglobalvar("zOffset"+player) > (vRes/2)){
                //setglobalvar("zOffset"+player, getglobalvar("zOffset"+player)-zVel);
            }
           
            //USED WHEN THE CHARACTER IS MOVED TO LEFT DIRECTION IN REAL TIME
            //DISABLED TO WORK ONLY FOR THE RIGHT DIRECTION, BUT THE LEFT DIRECTION WORKS CORRETLY TOO
            if(z + getglobalvar("zOffset"+player) < (vRes/2)){
                //setglobalvar("zOffset"+player, getglobalvar("zOffset"+player)+zVel);
            }

           
            //DEBUG INFO
            // drawstring(getglobalvar("xOffset"+player)/10000, 50+screenDif, 0, openborvariant("levelwidth"), openborconstant("MAX_INT")/100000);
            // drawstring(getglobalvar("xOffset"+player)/10000, 60+screenDif, 0, getglobalvar("xOffset"+player), openborconstant("MAX_INT")/100000);
            // drawstring(getglobalvar("xOffset"+player)/10000, 70+screenDif, 0, x, openborconstant("MAX_INT")/100000);

            //DRAW EVERYTHING IN REAL TIME
            drawspriteq(getglobalvar("screenP"+player), 0, openborconstant("MIN_INT"), maxZ+zAdd, getglobalvar("xOffset"+player), getglobalvar("zOffset"+player));
            changedrawmethod(NULL(),"reset", 1);
            changedrawmethod(NULL(),"enabled", 1);
            changedrawmethod(NULL(),"scalex", scaleX);
            changedrawmethod(NULL(),"scaley", scaleY);
            drawscreen(getglobalvar("screenP"+player), 0, screenDif, (maxZ*9)+player);
            drawspriteq(vScreen, 0, openborconstant("MIN_INT"), openborconstant("MAX_INT"), 0, 0);
        }
        else
        {
            if(getglobalvar("screenP"+player) != NULL()){setglobalvar("screenP"+player, NULL());}
        }
    }

    //VERTICAL
    if(type == 1){
        if(ent){
            void vScreen    = openborvariant("vscreen");
            float x            = getentityproperty(ent, "x");
            float z            = getentityproperty(ent, "z");
            float hRes        = openborvariant("hresolution");
            float vRes        = openborvariant("vresolution");
            float minZ        = openborvariant("PLAYER_MIN_Z");
            float maxZ        = openborvariant("PLAYER_MAX_Z");
            float xVel        = getlevelproperty("scrollspeed");
            float zVel        = getlevelproperty("scrollspeed");
            float zDif        = 40*player;
            float scaleX    = 256;
            float scaleY    = 256;
            float layerID;
            float layerV;
            float layerZ;
            float panelZ;
            float p1Screen;
            float p2Screen;
            int p1Layer;
            int p2Layer;

            //START AND DEFINE VARIABLES
            if(getglobalvar("screenP"+player) == NULL()){
                changeopenborvariant("viewportx", 0);
                changeopenborvariant("viewporty", 0);
                changeopenborvariant("viewportw", openborvariant("levelwidth"));
                changeopenborvariant("viewporth", openborvariant("levelheight"));
                changeentityproperty(ent, "position", hRes/6, minZ+zDif);
                setglobalvar("xOffset"+player, 0);
                setglobalvar("zOffset"+player, 0);
                setglobalvar("screenP"+player, allocscreen(hRes/2, vRes));
            }

            //READJUST SCREENS FOR TWO PLAYERS IN REAL TIME
            if(openborvariant("count_players") > 1){
                if((getglobalvar("xOffset0")*(-1)) > (getglobalvar("xOffset1")*(-1))+(hRes/2)){
                    p1Screen = hRes/2;
                    p2Screen = 0;
                    p1Layer = 0;
                    p2Layer = 2;
                    drawbox(p1Screen, 0, 1, 276, openborconstant("MAX_INT"), rgbcolor(255, 255, 255), 0);
                }
                else
                if((getglobalvar("xOffset1")*(-1)) > (getglobalvar("xOffset0")*(-1))+(hRes/2)){
                    p1Screen = 0;
                    p2Screen = hRes/2;
                    p1Layer = 2;
                    p2Layer = 0;
                    drawbox(p2Screen, 0, 1, 276, openborconstant("MAX_INT"), rgbcolor(255, 255, 255), 0);
                }
                else
                {
                    p1Screen = 0;
                    p2Screen = 0;
                    p1Layer = 0;
                    p2Layer = 0;
                }
            }
           
            //CLEAR SCREEN
            clearscreen(getglobalvar("screenP"+player));

            //ADJUST LEVEL OFFSET AS A "FAKE" XPOS FOR EACH SCREEN IN REAL TIME
            //USED WHEN THE CHARACTER IS MOVED TO RIGHT DIRECTION IN REAL TIME
            if(x > (getglobalvar("xOffset"+player)*(-1)) + (hRes/4)){
                if((getglobalvar("xOffset"+player)*(-1)) < (openborvariant("levelwidth")-hRes/2)){
                    setglobalvar("xOffset"+player, getglobalvar("xOffset"+player)-xVel);
                    changeentityproperty(ent, "subject_to_screen", 0);
                }
            }
           
            //USED WHEN THE CHARACTER IS MOVED TO LEFT DIRECTION IN REAL TIME
            if(x < (getglobalvar("xOffset"+player)*(-1)) + (hRes/4)){
                if((getglobalvar("xOffset"+player)*(-1)) > 0){
                    setglobalvar("xOffset"+player, getglobalvar("xOffset"+player)+xVel);
                    changeentityproperty(ent, "subject_to_screen", 0);
                }
            }

            //ADJUST LEVEL OFFSET AS A "FAKE" XPOS FOR EACH SCREEN IN REAL TIME
            //USED WHEN THE CHARACTER IS MOVED TO RIGHT DIRECTION IN REAL TIME
            if(z + getglobalvar("zOffset"+player) > (vRes/2)){
                //setglobalvar("zOffset"+player, getglobalvar("zOffset"+player)-zVel);
            }
           
            //USED WHEN THE CHARACTER IS MOVED TO LEFT DIRECTION IN REAL TIME
            if(z + getglobalvar("zOffset"+player) < (vRes/2)){
                //setglobalvar("zOffset"+player, getglobalvar("zOffset"+player)+zVel);
            }
           
            //FGLAYER 0 - BACK LAYER
            layerID    = 0;
            layerZ    = getlayerproperty("fglayer", layerID, "z");
            layerV    = getlayerproperty("fglayer", layerID, "xratio");
            panelZ    = minZ-50;
            //drawspriteq(getglobalvar("screenP"+player), 0, layerZ, panelZ-1, getglobalvar("xOffset"+player)*layerV, getglobalvar("zOffset"+player));

            //PANEL
            drawspriteq(getglobalvar("screenP"+player), 0, panelZ, minZ-1, getglobalvar("xOffset"+player), getglobalvar("zOffset"+player));

            //PLAYABLE AREA
            drawspriteq(getglobalvar("screenP"+player), 0, minZ, maxZ, getglobalvar("xOffset"+player), getglobalvar("zOffset"+player));

            //FGLAYER 1 - FRONT LAYER
            layerID    = 1;
            layerZ    = getlayerproperty("fglayer", layerID, "z");
            layerV    = getlayerproperty("fglayer", layerID, "xratio");
            drawspriteq(getglobalvar("screenP"+player), 0, maxZ+1, layerZ, getglobalvar("xOffset"+player)*layerV, getglobalvar("zOffset"+player));

            //DRAW EVERYTHING IN REAL TIME
            changedrawmethod(NULL(),"reset", 1);
            changedrawmethod(NULL(),"enabled", 1);
            changedrawmethod(NULL(),"scalex", scaleX);
            changedrawmethod(NULL(),"scaley", scaleY);

            //DRAW EACH PLAYER SCREEN SEPARATELLY
            if(player == 0){drawscreen(getglobalvar("screenP"+player), p1Screen, 0, (maxZ*9)+p1Layer);}
            if(player == 1){drawscreen(getglobalvar("screenP"+player), p2Screen, 0, (maxZ*9)+p2Layer);}

            //DRAW EVERYTHING TO THE MAIN SCREEN
            drawspriteq(vScreen, 0, openborconstant("MIN_INT"), openborconstant("MAX_INT"), 0, 0);
        }
        else
        {
            if(getglobalvar("screenP"+player) != NULL()){setglobalvar("screenP"+player, NULL());}
        }
    }
}

void normalScreen(int player)
{//Simulates a "split screen" feature (Kratus 02-2022)
 //Don't forget to set a "wait" in "at 0" on every level to lock the "xpos" scrolling to avoid screen "shaking"
 //Most things on the game will need to be scripted, once most native functions will not work in the level design

    void ent = openborvariant("count_players");
   
    if(ent >= 1){
        void vScreen    = openborvariant("vscreen");
        float hRes        = openborvariant("hresolution");
        float vRes        = openborvariant("vresolution");
        float minZ        = openborvariant("PLAYER_MIN_Z");
        float maxZ        = openborvariant("PLAYER_MAX_Z");
        float xVel        = getlevelproperty("scrollspeed");
        float zVel        = getlevelproperty("scrollspeed");
        float zDif        = 40*player;
        float scaleX    = 256;
        float scaleY    = 256;
        float layerID;
        float layerV;
        float layerZ;
        float panelZ;
        float pScreen;
        float x;
        int layer;

        //START AND DEFINE VARIABLES
        if(getglobalvar("screenP") == NULL()){
            changeopenborvariant("viewportx", 0);
            changeopenborvariant("viewporty", 0);
            changeopenborvariant("viewportw", openborvariant("levelwidth"));
            changeopenborvariant("viewporth", openborvariant("levelheight"));
            setglobalvar("xOffset", 0);
            setglobalvar("zOffset", 0);
            setglobalvar("screenP", allocscreen(openborvariant("levelwidth"), vRes));
        }

        //READJUST SCREENS FOR TWO PLAYERS IN REAL TIME
        if(openborvariant("count_players") <= 1){
            pScreen = 0;
            layer = 0;
            x = (getglobalvar("xOffset0")*(-1));
        }
        else
        {
            if((getglobalvar("xOffset0")*(-1)) > (getglobalvar("xOffset1")*(-1))){
                pScreen = 0;
                layer = 1;
                x = (getglobalvar("xOffset0")*(-1));
            }
            else
            if((getglobalvar("xOffset1")*(-1)) > (getglobalvar("xOffset0")*(-1))){
                pScreen = 0;
                layer = 1;
                x = (getglobalvar("xOffset1")*(-1));
            }
            else
            {
                pScreen = 0;
                layer = 3;
                x = (getglobalvar("xOffset0")*(-1));
            }
        }
       
        //CLEAR SCREEN
        clearscreen(getglobalvar("screenP"));

        //ADJUST LEVEL OFFSET AS A "FAKE" XPOS FOR EACH SCREEN IN REAL TIME
        //USED WHEN THE CHARACTER IS MOVED TO RIGHT DIRECTION IN REAL TIME
        if(x > (getglobalvar("xOffset")*(-1)) + (hRes/2)){
            if((getglobalvar("xOffset")*(-1)) < (openborvariant("levelwidth")-hRes/2)){
                setglobalvar("xOffset", getglobalvar("xOffset")-xVel);
            }
        }
       
        //USED WHEN THE CHARACTER IS MOVED TO LEFT DIRECTION IN REAL TIME
        if(x < (getglobalvar("xOffset")*(-1)) + (hRes/2)){
            if((getglobalvar("xOffset")*(-1)) > 0){
                setglobalvar("xOffset", getglobalvar("xOffset")+xVel);
            }
        }
       
        //DEBUG INFO
        drawstring(getglobalvar("xOffset")/10000, 70+zDif, 0, getlayerproperty("fglayer", 0, "z"), openborconstant("MAX_INT")/100000);
        drawstring(getglobalvar("xOffset")/10000, 80+zDif, 0, (getglobalvar("xOffset")*(-1)), openborconstant("MAX_INT")/100000);
       
        //FGLAYER 0 - BACK LAYER
        layerID    = 0;
        layerZ    = getlayerproperty("fglayer", layerID, "z");
        layerV    = getlayerproperty("fglayer", layerID, "xratio");
        panelZ    = minZ-50;
        //drawspriteq(getglobalvar("screenP"), 0, layerZ, panelZ-1, getglobalvar("xOffset")*layerV, getglobalvar("zOffset"));

        //PANEL
        drawspriteq(getglobalvar("screenP"), 0, panelZ, minZ-1, getglobalvar("xOffset"), getglobalvar("zOffset"));

        //PLAYABLE AREA
        drawspriteq(getglobalvar("screenP"), 0, minZ, maxZ, getglobalvar("xOffset"), getglobalvar("zOffset"));

        //FGLAYER 1 - FRONT LAYER
        layerID    = 1;
        layerZ    = getlayerproperty("fglayer", layerID, "z");
        layerV    = getlayerproperty("fglayer", layerID, "xratio");
        drawspriteq(getglobalvar("screenP"), 0, maxZ+1, layerZ, getglobalvar("xOffset")*layerV, getglobalvar("zOffset"));

        //DRAW EVERYTHING IN REAL TIME
        changedrawmethod(NULL(),"reset", 1);
        changedrawmethod(NULL(),"enabled", 1);
        changedrawmethod(NULL(),"scalex", scaleX);
        changedrawmethod(NULL(),"scaley", scaleY);
        drawscreen(getglobalvar("screenP"), pScreen, 0, (maxZ*9)+layer);
        drawspriteq(vScreen, 0, openborconstant("MIN_INT"), openborconstant("MAX_INT"), 0, 0);
    }
    else
    {
        if(getglobalvar("screenP") != NULL()){setglobalvar("screenP", NULL());}
    }
}
 
Last edited:
@Kratus , do you think there is a way for one of the screens to display one thing and for the other to display another?
example, left screen displays left eye Axel sprite (tinted blue), right screen displays right eye Axel sprite (tinted red)
Left screen features lft eye panel graphic, right screen features right eye panel graphic (remember that stereoscopy in Isometric requires some graphic elements to be doubled, not just shifted)

so in the case of Axel, i am thinking spawn animation spawns 2 sets of Axel sprites at the same time on anormal screen,
BUT in split screen the "other" Axel is a spawnbind entity that is only visible on the right screen

or to put it anothet way for easier testing, make an entity only visible on one screen & invisible for the other
 
This is beautiful ingame Kratus, I will try to use it well in a project and pay tribute to your magnificent scripts as it should be ;) . I will see if it won't occur any problems on other entities spawn like enemies.
 
@Kratus , do you think there is a way for one of the screens to display one thing and for the other to display another?
example, left screen displays left eye Axel sprite (tinted blue), right screen displays right eye Axel sprite (tinted red)
Left screen features lft eye panel graphic, right screen features right eye panel graphic (remember that stereoscopy in Isometric requires some graphic elements to be doubled, not just shifted)

so in the case of Axel, i am thinking spawn animation spawns 2 sets of Axel sprites at the same time on anormal screen,
BUT in split screen the "other" Axel is a spawnbind entity that is only visible on the right screen

or to put it anothet way for easier testing, make an entity only visible on one screen & invisible for the other
@oldyz I think yes. In fact, the content that is drawn on a screen is defined according to a "Z" value. For example, I can draw the only panel on the screen "A" and only the bglayer on the screen "B".

You can see an example below. Every "drawspriteq" draws a specific element on the screen, I can easily disable it for one screen and enable it for another screen.

C:
//FGLAYER 0 - BACK LAYER
layerID    = 0;
layerZ    = getlayerproperty("fglayer", layerID, "z");
layerV    = getlayerproperty("fglayer", layerID, "xratio");
panelZ    = minZ-50;
//drawspriteq(getglobalvar("screenP"+player), 0, layerZ, panelZ-1, getglobalvar("xOffset"+player)*layerV, getglobalvar("zOffset"+player));

//PANEL
drawspriteq(getglobalvar("screenP"+player), 0, panelZ, minZ-1, getglobalvar("xOffset"+player), getglobalvar("zOffset"+player));

//PLAYABLE AREA
drawspriteq(getglobalvar("screenP"+player), 0, minZ, maxZ, getglobalvar("xOffset"+player), getglobalvar("zOffset"+player));

//FGLAYER 1 - FRONT LAYER
layerID    = 1;
layerZ    = getlayerproperty("fglayer", layerID, "z");
layerV    = getlayerproperty("fglayer", layerID, "xratio");
drawspriteq(getglobalvar("screenP"+player), 0, maxZ+1, layerZ, getglobalvar("xOffset"+player)*layerV, getglobalvar("zOffset"+player));

But to understand your idea better, it would be good if you show a visual example, and then I can make some tests.
 
I love the new update of it. Maybe the split screen in horizontal side would be cool to see like Sonic the Hedgehog 2.


Incredible work! I can imagine using this for a 2D Musou style game.
I can imagine Dynasty Warriors style there.
 
By the time I thought, Kratus, you were the God of War but now I think you're the God of Code. :D

I'm impressed how you seek and overcome challenges! It's a message from a zero talent in coding person but this one is at least sincere. ^^
 
@bWWd
Is the screen not moving faster no matter what value you put? Or is there some glitch/issue during the process? I will check it.

@16-bit Fighter
Thanks buddy! Yeah, I love code challenges in OpenBOR, and this engine still continues to surprise me at each new challenge :)

@maxman
Yeah, I like the horizontal mode too. I will continue working on it, the idea is to create an option to change between horizontal/vertical orientations and be accessible by script.
 
Well, screen lags behind characters when running, i didnr changed anything

@bWWd I need to develop a better way to calculate the screen "moving" rate, I think that adding more pixels per cycle will not reproduce the same behaviour as the native engine "xpos".

Different of the method I'm using, it seems that the engine multiplies how much times the entire process runs instead of adding more pixels. Until I find a better way to do it, we can temporarily "double" the scrolling speed by repeating the all the process twice (or more times).

This way we can make the opposite, reducing the pixel amount per cycle to control the scrolling speed instead of increasing more and causing lag.

C:
if(openborvariant("in_level")){
    if(!openborvariant("pause")){
        splitScreen(0, 1);
        splitScreen(0, 1);
        splitScreen(1, 1);
        splitScreen(1, 1);
        normalScreen(2);
        normalScreen(2);
        clearspriteq();
    }
}
 
Back
Top Bottom