Coding Awareness
This is out of my league
 33%  [ 1 ]
I might know some things that can help
 33%  [ 1 ]
I can fix your issue no-problems
 33%  [ 1 ]
Total Votes : 3

hey guys...
NDS programming of Maplestory DS has proved to be troublesome xD I've decided to completely rebuild from scratch and redesign it for the PSP. A group I'm working with has a pretty decent knowledge base of PSP programming, as well as 2 running WIFI communication methods. One will run as a PSP-Live Friends list and invite system, the other is built for 128 multiplayer (per server). This allows me to fully design an actual MMO for the PSP. Some of the major changes are as follows:

1) Game Theme Change - I'm pulling away from a Maplestory remake, and just doing the Maplestory side-scrolling engine.
2) Ideal Classes - Vampire, Beast (males are foxes, females are cats?)... not fully planned
3) Level System - 100 possible Melee levels, 100 possible Magical levels. Max of 100 levels distributable.
4) Rebirth - 2 Players of opposite gender can 'mate' their characters, making a new male or female (gender change possible) character. Parents are destroyed in the process. New character will have some bonuses for non in-bred characters xD. Unlimited max rebirths?
5) MMORPG - woot, thats right, 128 people can play per 'channel' simultaneously.

So far, I've successfully designed the map vs camera control. When players move outside of an invisible boundary, the camera will begin to focus when the player stops moving as long as map boundary limitations haven't been met.

This brings us to my first problem requiring assistance from other Cemetech members. the PNG limitations are 512x512. PSP screen limitations 480x272. Possible Map sizes WILL be InfxInf. Basically, I now have to design a Map Tile system. This will allow me to increase the size of the map past the PNG size limitations. I'm still not sure how to go about this.

heres a snippet of the character movement process deciding the player location, map location, and (yet to be implemented) player on map location.

Code:

      if(osl_keys->pressed.up){ moveY = 0; }
      if(osl_keys->held.up){
         if ((plyr.Y - 5 >= 92) && (map.Y < map.minY)) {  plyr.Y -= 5; }                  //green wall
         else if ((plyr.Y - 5 >= 67) && (map.Y < map.minY)) {  plyr.Y -= 5; distY = 136 - plyr.Y; YTension = distY/10; }   //red wall
         else if (map.Y - 5 > map.minY) { map.Y -= 5; }            //map wall
         else if ((map.Y - 5 <= map.minY) && (plyr.Y - 5 >= 1)) { plyr.Y -= 5; YTension = 0; }
      }
      if(osl_keys->released.up){ moveY = 1; }
      if(osl_keys->pressed.down){ moveY = 0; }
      //Vertical Movement
      if(osl_keys->held.down){
         if ((plyr.Y + 5 <= 182) && (map.Y > map.maxY)) { plyr.Y += 5; }
         else if ((plyr.Y + 5 <= 206) && (map.Y > map.maxY)) { plyr.Y += 5; distY = plyr.Y - 136; YTension = distY/10; }
         else if (map.Y + 5 < map.maxY - 272) { map.Y += 5; }
         else if ((map.Y +5 >= map.maxY - 272) && (plyr.Y +5 <= 272)) { plyr.Y += 5; YTension = 0; }
      }
      if(osl_keys->released.down){ moveY = 1; }
      if(osl_keys->pressed.left){ moveX = 0; }
      if(osl_keys->held.left){
         if ((plyr.X - 5 >= 195) && (map.X > map.minX)) { plyr.X -= 5; }
         else if ((plyr.X - 5 >= 171) && (map.X > map.minX)) { plyr.X -= 5; distX = 240 - plyr.X; XTension = distX/10; }
         else if (map.X - 5 > map.minX) { map.X -= 5; }
         else if ((map.X - 5 <= map.minX) && (plyr.X - 5 >= 1)) { plyr.X -= 5; XTension = 0; }
      }
      if(osl_keys->released.left){ moveX = 1; }
      if(osl_keys->pressed.right){ moveX = 0; }
      if(osl_keys->held.right){
         if ((plyr.X + 5 <= 286) && (map.X < map.maxX)) { plyr.X += 5; }
         else if ((plyr.X + 5 <= 310) && (map.X < map.maxX)) { plyr.X += 5; distX = plyr.X - 240; XTension = distX/10; }
         else if (map.X + 5 < map.maxX - 480) { map.X += 5; }
         else if ((map.X +5 >= map.maxX - 480) && (plyr.X +5 <= 470)) { plyr.X += 5; XTension = 0; }
      }
      if(osl_keys->released.right){ moveX = 1; }


current picture snippets:

Code:

//initialise
OSL_IMAGE *mapIMG = oslLoadImageFilePNG("Resources/Maps/map0001.png", OSL_IN_RAM | OSL_SWIZZLED, OSL_PF_8888);

//draw
oslDrawImageXY(mapIMG, 1-map.X, 1-map.Y);

note that (1-map.X) essentially makes the screen move in the correct directions

that SHOULD be sufficient info to help you develop a map tiling system. I have a lack of knowledge on how this operation should be done.

Current Credit To's:
Komak57 - for my ideas and Bulk programming
Yamagushi - for his implementation of YamaNET friends list and 1v1~4 anti-server hosting Online library as well as his skeleton code used for the core of the menu system.
jonlimle - for his eNET hostable server allowing 128 simultaneous PSP->Server Online Server & Library
HakEsaK - for his assistance with the core camera implementations
#evolved-entertainment - for their continued support
##psp-programming - for their continued support
Unnamed Image Creators from google - where would we be without some debugging images

~notes: screenshots will be edited in as they come[/quote]

Left 480x272 pixels

Center 480x272 pixels (with bleed error)
Problem was solved thanks to "A_Nub" and "Tomaz"


Code:

   OSL_IMAGE *mapIMG[4][4] = {{ oslLoadImageFilePNG("Resources/Maps/map1_1.png", OSL_IN_RAM | OSL_SWIZZLED, OSL_PF_8888),oslLoadImageFilePNG("Resources/Maps/map1_2.png", OSL_IN_RAM | OSL_SWIZZLED, OSL_PF_8888),oslLoadImageFilePNG("Resources/Maps/map1_3.png", OSL_IN_RAM | OSL_SWIZZLED, OSL_PF_8888),oslLoadImageFilePNG("Resources/Maps/map1_4.png", OSL_IN_RAM | OSL_SWIZZLED, OSL_PF_8888) },
                        { oslLoadImageFilePNG("Resources/Maps/map2_1.png", OSL_IN_RAM | OSL_SWIZZLED, OSL_PF_8888),oslLoadImageFilePNG("Resources/Maps/map2_2.png", OSL_IN_RAM | OSL_SWIZZLED, OSL_PF_8888),oslLoadImageFilePNG("Resources/Maps/map2_3.png", OSL_IN_RAM | OSL_SWIZZLED, OSL_PF_8888),oslLoadImageFilePNG("Resources/Maps/map2_4.png", OSL_IN_RAM | OSL_SWIZZLED, OSL_PF_8888) },
                        { oslLoadImageFilePNG("Resources/Maps/map3_1.png", OSL_IN_RAM | OSL_SWIZZLED, OSL_PF_8888),oslLoadImageFilePNG("Resources/Maps/map3_2.png", OSL_IN_RAM | OSL_SWIZZLED, OSL_PF_8888),oslLoadImageFilePNG("Resources/Maps/map3_3.png", OSL_IN_RAM | OSL_SWIZZLED, OSL_PF_8888),oslLoadImageFilePNG("Resources/Maps/map3_4.png", OSL_IN_RAM | OSL_SWIZZLED, OSL_PF_8888) },
                        { oslLoadImageFilePNG("Resources/Maps/map4_1.png", OSL_IN_RAM | OSL_SWIZZLED, OSL_PF_8888),oslLoadImageFilePNG("Resources/Maps/map4_2.png", OSL_IN_RAM | OSL_SWIZZLED, OSL_PF_8888),oslLoadImageFilePNG("Resources/Maps/map4_3.png", OSL_IN_RAM | OSL_SWIZZLED, OSL_PF_8888),oslLoadImageFilePNG("Resources/Maps/map4_4.png", OSL_IN_RAM | OSL_SWIZZLED, OSL_PF_8888) } };

//----- skipped code ------

         // ----- Tile System -----
         iX = 0;
         for(iX=0;iX<tiles.X;iX++) {
            iY = 0;
            for(iY=0;iY<tiles.Y;iY++) {
               oslDrawImageXY(mapIMG[iY][iX], (((iX - 0) * 250) - map.X), (((iY - 0) * 68) - map.Y));
            }
         }
         // ----- Tile System End -----


New Focus:
It's been brought to my attention that there may be another method to moving plyr vs map that may be more compatible with what I have in mind. A_Nub suggests that i take a more direct approach when dealing with the variables. Instead of using the Tension system (think of a rubber band between the center of the screen and the sprite), he recommends using a throttle system, which wont center the screen back, but will smoothly scroll the background, and allow me a more accurate method to get the position of the player with respect to the map.

method currently used:

Code:

if (player hasnt touched a barrier) { move player }
else if (player hit green barrier) { move player, count distance for tention }
else if (player hit red wall) { move map }
else if (player reached the end of the map) { move player, destroy tension }

Suggested method:

Code:

if(player hasnt hit red wall) { full throttle player; nill throttle map; }
else if(player hasnt reached wall){ nill throttle player; full throttle map; }
else (player has met the map limitation) { full throttle player; nill throttle map; }


Right away the suggested method is full of holes:
A) theres no boundary limiting the player to stay on-screen after you've reached the map's limitations.
B) the throttle control is instant and as is, has no room for easing into the change
C) no longer centers the camera on player (move sprite and map until within the arranged distance from center)
with a lack of new information, I'm posting again.

I'm going to go and try a mix of the 2... I'll try changing the indefinite 5 speed to a 'throttle control' based on distance from center (limiter at dist=70). This should allow me to eliminate the 'hasn't hit red wall' but still technically have one. the formula I'm looking into is 'whats my distance in percent(45~70 / 70) * terminal speed(5)' then the remainder of the 5 will go to map.speed. The throttle will allow me to keep the process smooth, while the exact numbers will still allow me to do what i need. I'll check it out and get back to ya with my next glitch.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
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 vote in polls in this forum

 

Advertisement