Xentales

Talk about stuff, and if you must, about Xenimus
It is currently 21 Jun 2018 19:24

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 74 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Updated Xenimus Map?
PostPosted: 13 Jul 2013 02:10 
Offline

Joined: 05 Nov 2007 11:14
Posts: 128
65500 x 65500 32bit image loaded takes 17.161GB of ram.


Top
 Profile  
 
 Post subject: Re: Updated Xenimus Map?
PostPosted: 13 Jul 2013 02:25 
Offline

Joined: 05 Nov 2007 11:14
Posts: 128
Code:
 if ( v0 == flt_5677F00 )                      // if something is 1? this value is wierd, it's 1 in open world and otherwise varies between 0.4 and 1 depending on camera angle, also dynamically changes in some dungeons even while not moving. DO NOT UNDERSTAND
  {
    dword_57FAFEC = (signed int)(flt_5677EF8 - flt_5677EFC * 5.0);
    if ( dword_57FAFEC < 1 )
      dword_57FAFEC = 1;
    ambientlight = (double)dword_57FAFEC / 255.0;
  }
  if ( bufflags & 8 && ambientlight < 0.4000000059604645 )// night vision
    ambientlight = 0.40000001;
  if ( dword_543DEC )                           // if in a menu that is fullscreen?
    ambientlight = v0;                          // v0 = 1


Top
 Profile  
 
 Post subject: Re: Updated Xenimus Map?
PostPosted: 13 Jul 2013 02:39 
Offline

Joined: 05 Nov 2007 11:14
Posts: 128
Yeah here's how you fix the light.

ambient light is 0x02EE7D40
updatelight is 0x4317B0

hook updatelight, call it so stuff is set, then set ambient to a value AFTER the call, this will make all dungeons and dungeon server light


Top
 Profile  
 
 Post subject: Re: Updated Xenimus Map?
PostPosted: 13 Jul 2013 02:41 
Offline

Joined: 05 Nov 2007 11:14
Posts: 128
Code:
int __cdecl UpdateLightHook()
{
   int ret = g_updateLightHook();
   float* test = (float*)0x02EE7D40;
   *test = 1;
   return ret;
}


Top
 Profile  
 
 Post subject: Re: Updated Xenimus Map?
PostPosted: 13 Jul 2013 03:34 
Offline

Joined: 05 Nov 2007 11:14
Posts: 128
More info, look at this array 0x536C70

This is an array that describes how to handle each map layer 3. However for map generation it has a few special values that we can abuse :)

0x2E = handle as normal
0x52 = don't draw roofs
0x58 = don't draw floors


Top
 Profile  
 
 Post subject: Re: Updated Xenimus Map?
PostPosted: 13 Jul 2013 03:39 
Offline

Joined: 05 Nov 2007 11:14
Posts: 128
https://dl.dropboxusercontent.com/u/888 ... tempt2.png


Top
 Profile  
 
 Post subject: Re: Updated Xenimus Map?
PostPosted: 13 Jul 2013 10:42 
Offline
User avatar

Joined: 30 Apr 2013 00:03
Posts: 221
oh wow nice. i was trying to play with light but couldnt figure it out haha. I hooked the directx call SetLight and i think i never was called. Ill have to play around with those values


Top
 Profile  
 
 Post subject: Re: Updated Xenimus Map?
PostPosted: 13 Jul 2013 12:15 
Offline
User avatar

Joined: 30 Apr 2013 00:03
Posts: 221
This is pretty much how my stats are:
Windowed mode I can scan both maps at the same time while still using my computer. The downside here is I only get 12-13 fps on each. Estimated time of finish is 26 hours.

Now in full screen or if I leave the window active I get around 35 fps. Downside, 1 map at a time, computer is useless while scanning. Estimated time per map 10 hours. So 20 hours total for both maps.

in windows mode, I can not uncap the fps (as far as I know). Im pretty sure in full screen you can uncap fps in createdevice's parameters. I have not tested yet. Idealy speaking, it would take about 320 fps to get a 1 hour scan time. I would have to say thats near impossible.


Top
 Profile  
 
 Post subject: Re: Updated Xenimus Map?
PostPosted: 13 Jul 2013 12:37 
Offline

Joined: 05 Nov 2007 11:14
Posts: 128
Disable vsync in graphics options for higher fps.

Though if you're only getting 35, chances are your GPU is maxing out, unless you have a wierd 35hz monitor noone has heard of.


Top
 Profile  
 
 Post subject: Re: Updated Xenimus Map?
PostPosted: 13 Jul 2013 12:59 
Offline
User avatar

Joined: 30 Apr 2013 00:03
Posts: 221
Well I get 60 normally, then mapping I drop to 35. This is all on my ultrabook so keep that in mind im not using a gaming compute to do this. And yeah yesterday I had 3 xens running, 2 mapping and 1 playing xenimus for me. I mean me playing xenimus *cough*


Top
 Profile  
 
 Post subject: Re: Updated Xenimus Map?
PostPosted: 13 Jul 2013 13:50 
Offline

Joined: 05 Nov 2007 11:14
Posts: 128
I just did some refactoring in my code, making sure it was called exactly after present was called, and I've got my map generation from about 35 fps to 150 fps.

I think the limiting factor now is the hard drive.


Top
 Profile  
 
 Post subject: Re: Updated Xenimus Map?
PostPosted: 13 Jul 2013 13:53 
Offline

Joined: 05 Nov 2007 11:14
Posts: 128
Also xenlua is getting an update adding a FPS counter, because I just added it to test how quick this was, why not add it to xenlua.

Hovering over also gives average FPS since last map load.


Top
 Profile  
 
 Post subject: Re: Updated Xenimus Map?
PostPosted: 13 Jul 2013 13:55 
Offline
User avatar

Joined: 30 Apr 2013 00:03
Posts: 221
So you placed the screen shot code in present instead of endscene?


Top
 Profile  
 
 Post subject: Re: Updated Xenimus Map?
PostPosted: 13 Jul 2013 14:13 
Offline

Joined: 05 Nov 2007 11:14
Posts: 128
Sorry it is after EndScene, I don't usually reference DX9, and DX9 is the last time EndScene was an API.


Top
 Profile  
 
 Post subject: Re: Updated Xenimus Map?
PostPosted: 13 Jul 2013 14:26 
Offline
User avatar

Joined: 30 Apr 2013 00:03
Posts: 221
Disabled vsync, FPS spikes as high as 200. But when i start mapping it drops back down to 30.

Code:
HRESULT WINAPI hkEndScene(LPDIRECT3DDEVICE9 pDevice)
{
   //if(menuFont == NULL) D3DXCreateFont(pDevice, 20, 0, FW_BOLD, 0, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, TEXT("Arial"), &menuFont );
   
   //sprintf_s(display, "FPS: %i | Y%04i | X%04i", *FPS, y, x);
   //menuFont->DrawTextA(NULL, display, -1, &infoDisplay, 0, D3DCOLOR_ARGB(255, 255, 255, 255));
   
   HRESULT ret = oEndScene(pDevice);

   if(bcap)
   {
      
      sprintf_s(directory, "map\\%s\\Y%04i\\", ServerFolder, y);
      CreateDirectory(directory, NULL);

      
      sprintf_s(file, "map\\%s\\Y%04i\\X%04i.jpeg", ServerFolder, y, x);
      TakeScreenshotWindowed(file, (width/2)-120, (height/2)-120, 240, 240);
      
      if(x == 1073 && y == 1073)
         bcap = false;
      else
      {
         if(x == 1073)
         {
            x = 0;
            y++;
            *LocX = 30.0f;
            *LocY += 60.0f;
         }
         else
         {
            x++;
            *LocX += 60.0f;
         }
      }

   }
   return ret;
}


edit: i believe its sprintf that is limiting me. I will have to do a quick test.
edit2: its not =(


Top
 Profile  
 
 Post subject: Re: Updated Xenimus Map?
PostPosted: 13 Jul 2013 14:59 
Offline

Joined: 05 Nov 2007 11:14
Posts: 128
So I wasn't recording at 150 fps, it was ~70 fps because it was only recording every 2 frames due to an old bug that is now fixed.

That 70 is now increased to 120 by offloading file writes to background threads.


Top
 Profile  
 
 Post subject: Re: Updated Xenimus Map?
PostPosted: 13 Jul 2013 15:51 
Offline
User avatar

Joined: 30 Apr 2013 00:03
Posts: 221
So are you saying that you are passing the surface off to a queue then having a separate thread read the queue and save the file?

as in
Code:
queue<IDirect3DSurface9*> screen;


and
Code:
void TakeScreenshotWindowed(const char* outname, int32 sx, int32 sy, int32 width, int32 height)
{
   IDirect3DSurface9* surface;
   g_Device->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &surface);
   screen.push_back(&surface);
/*
   if (sx != -1)
   {
      RECT rct;
      rct.left = sx;
      rct.right = sx + width;
      rct.top = sy;
      rct.bottom = sy + height;
      D3DXSaveSurfaceToFile(outname, D3DXIFF_JPG, surface, NULL, &rct);
   }
   else
      D3DXSaveSurfaceToFile(outname, D3DXIFF_JPG, surface, NULL, NULL);

   surface->Release();*/
}


something like that?


Top
 Profile  
 
 Post subject: Re: Updated Xenimus Map?
PostPosted: 13 Jul 2013 15:55 
Offline

Joined: 05 Nov 2007 11:14
Posts: 128
Code:
void UIController::TakeScreenshot(const char* outname, int32 sx /*= -1*/, int32 sy /*= -1*/, int32 width /*= -1*/, int32 height /*= -1*/)
{
   if (GetPresentationParams().Windowed == TRUE)
   {
      TakeScreenshotWindowed(outname, sx, sy, width, height);
      return;
   }

   std::string outstr = outname;

   LPDIRECT3DSURFACE9 surface;
   m_d3ddev->CreateOffscreenPlainSurface(screenWidth, screenHeight, D3DFMT_A8R8G8B8, D3DPOOL_SCRATCH, &surface, NULL);

   m_d3ddev->GetFrontBufferData(0, surface);

   RECT rct;
   memset(&rct, 0, sizeof(rct));

   if (sx != -1)
    {
       rct.left = sx;
       rct.right = sx + width;
       rct.top = sy;
       rct.bottom = sy + height;
       //D3DXSaveSurfaceToFile(outname, D3DXIFF_JPG, m_scratchSurface, NULL, &rct);
      boost::thread thr(boost::bind(&UIController::TakeScreenshotBackgroundSave, this, outstr, surface, rct, true));
    }
    else
   {
      //       D3DXSaveSurfaceToFile(outname, D3DXIFF_JPG, m_scratchSurface, NULL, NULL);
      boost::thread thr(boost::bind(&UIController::TakeScreenshotBackgroundSave, this, outstr, surface, rct, false));
   }
}


Code:
void UIController::TakeScreenshotBackgroundSave( std::string outname, LPDIRECT3DSURFACE9 surface, RECT rct, bool userct )
{
   RECT* rctptr = NULL;
   if (userct)
      rctptr = &rct;
   D3DXSaveSurfaceToFile(outname.c_str(), D3DXIFF_BMP, surface, NULL, rctptr);
   surface->Release();
}


Top
 Profile  
 
 Post subject: Re: Updated Xenimus Map?
PostPosted: 13 Jul 2013 15:56 
Offline
User avatar

Joined: 30 Apr 2013 00:03
Posts: 221
I guess for me, since im actively using my laptop anyways, 12-13fps is the max i can get no matter what. Because the second the window no longer has focus, FPS drops down to 12-13 anyways. Though it would be nice to make the mapping quicker if i did intend to let it map without interruption.


Top
 Profile  
 
 Post subject: Re: Updated Xenimus Map?
PostPosted: 13 Jul 2013 16:02 
Offline

Joined: 05 Nov 2007 11:14
Posts: 128
Xenimus caps itself to 20 fps while not the focus anyway.


Top
 Profile  
 
 Post subject: Re: Updated Xenimus Map?
PostPosted: 13 Jul 2013 18:07 
Offline

Joined: 05 Nov 2007 11:14
Posts: 128
I think I've got this as fast as it's going to go.

I disabled the partial screenshot to show the debug information while generating, as you see it now records a bunch of stuff.

Image


Top
 Profile  
 
 Post subject: Re: Updated Xenimus Map?
PostPosted: 13 Jul 2013 18:23 
Offline
User avatar

Joined: 30 Apr 2013 00:03
Posts: 221
This is how mine looks running @ 800x600 in windowed

Image


Top
 Profile  
 
 Post subject: Re: Updated Xenimus Map?
PostPosted: 13 Jul 2013 18:29 
Offline
User avatar

Joined: 30 Apr 2013 00:03
Posts: 221
Heres a quick DS preview of my DS scan
https://www.dropbox.com/s/mw6wlo8vfxzwwiy/DS1-30.jpg


Top
 Profile  
 
 Post subject: Re: Updated Xenimus Map?
PostPosted: 13 Jul 2013 18:30 
Offline

Joined: 05 Nov 2007 11:14
Posts: 128
Test of DS, took about 10mins to generate this, so yes, I believe the 1 hour is a lie.

https://dl.dropboxusercontent.com/u/8888648/DSTEST.png


Top
 Profile  
 
 Post subject: Re: Updated Xenimus Map?
PostPosted: 13 Jul 2013 18:37 
Offline
User avatar

Joined: 30 Apr 2013 00:03
Posts: 221
Its possible if you could achieve about 100FPS more lol


Top
 Profile  
 
 Post subject: Re: Updated Xenimus Map?
PostPosted: 13 Jul 2013 19:26 
Offline
User avatar

Joined: 30 Apr 2013 00:03
Posts: 221
This is probably the largest sized tiles i can render on my computer (whole map would be a 6x6 matrix of the tiles)

image is 10800x10740

Jpeg @ 80% save quality (~17mb)
https://www.dropbox.com/s/7dcwmjl75nunqne/DS1-1.jpg


Top
 Profile  
 
 Post subject: Re: Updated Xenimus Map?
PostPosted: 13 Jul 2013 19:55 
Offline
User avatar

Joined: 30 Apr 2013 00:03
Posts: 221
Andy, do you know how the xenmap0 (ingame map) works? Can it be any size, but has to maintain the original 512x512 ratio? Like the original one that comes with xen is 512x512, the one uber posted early on in the thread is 1024x1024. So can a map be created 2048x2048 or 2560x2560 ect ect? Because then i could just resize the tiles im creating down to 512x512 and stitch them together into an ingame map (once i do the main server that is)

And DS 1-2 (~11mb)
https://www.dropbox.com/s/um9xed87v4igkz7/DS1-2.jpg


Top
 Profile  
 
 Post subject: Re: Updated Xenimus Map?
PostPosted: 13 Jul 2013 21:29 
Offline
User avatar

Joined: 30 Apr 2013 00:03
Posts: 221
SOOO much unused space man. I dont understand why EJ is spending time "making new quests blablabla" instead of adding new places to hunt to the game. DS is only like 30% used man.

First row of DS (1/6). Somehow got this image down to >1mb
https://www.dropbox.com/s/zcoa686wu3mi2tg/DS1.jpg


Top
 Profile  
 
 Post subject: Re: Updated Xenimus Map?
PostPosted: 14 Jul 2013 00:04 
Offline
User avatar

Joined: 30 Apr 2013 00:03
Posts: 221
First part of main server:
https://www.dropbox.com/s/vsga9tjnh07fxao/XP1.jpg


Top
 Profile  
 
 Post subject: Re: Updated Xenimus Map?
PostPosted: 14 Jul 2013 03:38 
Offline

Joined: 05 Nov 2007 11:14
Posts: 128
So the ingame map is likely that size because of npow2 rules on older graphics cards. MSDN should help you. Or google.

Tex coords are relative, so replacing with a higher/lower resolution should be fine.


Top
 Profile  
 
 Post subject: Re: Updated Xenimus Map?
PostPosted: 14 Jul 2013 03:54 
Offline
User avatar

Joined: 30 Apr 2013 00:03
Posts: 221
I did attempt to resize the map to 3072x3072 but it didnt work so well.


Anyways i have good new! I have finally figured out the god damn Google Maps API. Its looking like ill have ~7-8 zoom levels.

Now i just have to MAKE the zoom levels.

Heres how the zoom levels are gonna be made.

Zoom 8 = 1x1 tiles.
7 = 2x2 tiles
6 = 4x4 tiles
5 = 8x8 tiles
4 = 16x16
ect ect.

So to say the least, this may take awhile. But it will come about eventually. Only real problem i can see is some of the maps edges will get cut off as the zoom level decreases. as 16 does not go into 1074 evenly.


Top
 Profile  
 
 Post subject: Re: Updated Xenimus Map?
PostPosted: 14 Jul 2013 16:18 
Offline
User avatar

Joined: 30 Apr 2013 00:03
Posts: 221
Corrected zoom levels:

Code:
if(zoom == 10) //1x1
     tileRange = 1072;
  else if(zoom == 9) //2x2
     tileRange = 536;
  else if(zoom == 8) //4x4
     tileRange = 267;
  else if(zoom == 7) //8x8
     tileRange = 133;
  else if(zoom == 6) //16x16
     tileRange = 66;
  else if(zoom == 5) //32x32 really its 33.5x33.5 this will give us 1024 tiles
     tileRange = 32;
  else if(zoom == 4) //67x67
     tileRange = 16;
  else if(zoom == 3) //134x134
     tileRange = 8;
  else if(zoom == 2) //268x268
     tileRange = 4;
  else if(zoom == 1) //536x536
     tileRange = 2;


So ill end up with 10 zoom levels total. This is still going to take ALONG time for me to resize everything. Currently working on zoom level 9,8,7,6,&5 at the same time.

already have server space being set up for me. To give everyone an idea of how much data im creating and eventually transferring to a server:

10 : 1072 folders : ~11mb folders : ~12gigs
9 : 536 folders : ~3mb folders : ~1.6gigs
8 : 267 folders : ~1.8mb folders : ~500mb
7 : 133 folders : ~800kb folders : ~100mb
6 : 66 folders : ~300kb folders : ~20mb
5 : 32 folders : ~100kb folders : ~3mb

so i mean all in all, its gonna be closer to 20gigs of images on a server (zoom level 10 is really around 15gigs when i checked on my computer). Lol


Top
 Profile  
 
 Post subject: Re: Updated Xenimus Map?
PostPosted: 15 Jul 2013 00:17 
Offline
User avatar

Joined: 30 Apr 2013 00:03
Posts: 221
Preview of the project, just a quick little video showing a few different zooms. I may leave out zoom level 10 as zoom 9 looks just as good.

http://youtu.be/3l-4hWU0j7c

Its probably about a week or two away from deployment though. Depends on how fast i can finish the zoom levels and upload them to a server.


Top
 Profile  
 
 Post subject: Re: Updated Xenimus Map?
PostPosted: 16 Jul 2013 18:08 
Offline
User avatar

Joined: 30 Apr 2013 00:03
Posts: 221
Almost done. Uploading zooms 1-7 to the server right now. Zooms 8-9 are still being worked on.

For anyone that wants the latest map for xen i just created this one. Works ingame perfect.

https://www.dropbox.com/s/jpm9xzxx7ca7r9p/xenmap0.bmp


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 74 posts ]  Go to page Previous  1, 2

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


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

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