Iris2.de

Iris2-Forum
It is currently Sat Dec 21, 2024 12:44 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Skybox Fix
PostPosted: Tue Aug 02, 2011 8:43 am 
Offline
User avatar

Joined: Sat Jul 04, 2009 8:52 pm
Posts: 25
Quote:
Iris development is currently on halt, and it is unclear when and if it is going to continue.
We still check the forums every now and then to see if anyone wants to take up the project or encounters things that are easy to fix.
Community contributions have been virtually zero in the last few months/years, so i doubt it, but you never know.
We still continue to develop the lugre framework/lib used in iris in other projects, and i'm planning to clean up iris codebase a bit at some point, but not sure when that'll be.


Then if you accept fixes, remember that?

Quote:
Also the skybox does not change when exiting from a dungeon or chaging facets, you can see the malas skybox in trammel in the obsidian terrain screenshoot.


I've been looking at the code and fixed it (probably with the worst code that can be used to fix it, so change it if there is a better way).

Diff file (with a lot of annoying comments, file without comments attached):
Code:
Index: /lua/lib.loading.lua
===================================================================
--- /lua/lib.loading.lua   (revision 3)
+++ /lua/lib.loading.lua   (revision 4)
@@ -515,4 +515,5 @@
     profile:StartSection("compass")
     SetCompassMapIndex(index)
+    Renderer3D:MapAreaCheck()
     
     profile:Finish()
Index: /lua/lib.3d.map.lua
===================================================================
--- /lua/lib.3d.map.lua   (revision 3)
+++ /lua/lib.3d.map.lua   (revision 4)
@@ -144,7 +144,12 @@
   end
   --~ print("Renderer3D:MapAreaCheck",x,y,activearea)
-   if (gLastMapArea == activearea) then return end
+   local terrainvisible = ({CalcBlendOutZ()}) [2]
+   local DoSetMapAreaEnv = true
+   if (gLastMapArea == false) then gLastMapArea = gMaps[gMapIndex] end --if you don't change this when changing maps gLastMapArea will be false.
+   if (activearea == false) then activearea = gMaps[gMapIndex] end --if you don't change this when changing maps activearea will be false.
+   if (gLastMapArea == activearea and gLastMapAreaTerrainVisible == terrainvisible) then DoSetMapAreaEnv = false end --therefore with the old code ( if (gLastMapArea == activearea) then return end) it would be like nothing changed and SetMapAreaEnv wouldn't be called. Also with the old code gLastMapArea would not be the real last area where the character stayed.
   gLastMapArea = activearea --Therefore even if the program does not do anything gLastMapArea has to be changed.
-   self:SetMapAreaEnv(activearea or gMaps[gMapIndex])
+   gLastMapAreaTerrainVisible = terrainvisible --Same
+   if (DoSetMapAreaEnv == true) then self:SetMapAreaEnv(activearea or gMaps[gMapIndex]) end --If activearea is false it will be changed to the current map, so I think  "or gMaps[gMapIndex]" is not required (correct me if I'm wrong and if not remove it).
end


I've noticed that in 2D mode parrots are vortexs. What is it related to, or to what file? I've been searching to find out if it is difficult to fix or easy but I can't find the related code.

PD: WTF http://imageshack.us/photo/my-images/21 ... uloww.png/ (It should be allowed in a coding forum).

Diff file without comments: http://pastebin.com/29S4s0c2


Top
 Profile  
 
 Post subject: Re: Skybox Fix
PostPosted: Tue Aug 02, 2011 9:40 am 
Offline
iris2-developer
User avatar

Joined: Tue Apr 18, 2006 10:28 pm
Posts: 823
Location: Munich, Bavaria, Germany
cave skybox patch : thanks, i'll look into it later this evening if i can find the time.

Diff upload in forum not allowed : no idea how to enable it.

parrot=vortex in 2d : it's the same with elves and elven clothes, gargoyles etc, probably everything new art-wise from the mondains legacy extension. It's probably an error in calculating the right anim-ids or in accessing the data of the ml anims. I think anim5.idx/anim5.mul, but i'm not sure.
The file displaying creatures(parrot) and clothes in 2d mode is lua/lib.2d.mobile.lua ,
The file loading the graphics for that is src/data_anim.cpp

in lib.2d.mobile.lua we added a hack to make the elf at least look like a human,

line 159 :
Code:
if (mobile.artid == 605) then mobile.artid = 400 end -- elf
if (mobile.artid == 606) then mobile.artid = 401 end
if (mobile.artid == 607) then mobile.artid = 402 end -- elf ghost
if (mobile.artid == 608) then mobile.artid = 403 end

605/606 are male and female elf,
400/401 are male and female human

the "artid" send from the server is combined with the direction the mobile is looking in to get an id for the actual run/idle/fight... animation.
i don't remember the details at the moment, but this function should be worth looking into :
local iAnimID = Anim_GetMoveAnim(iModelID,iLoaderIndex,mount,bRun)
iLoaderIndex is the index of the anim*.mul file, e.g. anim4.mul vs anim5.mul ...
Also for clothing etc, some of the *.def files in the uo directory have to be considered.

creatures/monsters etc are rendered as one single graphic,
but humans can have visible equip like clothes/weapons/armor..

also there's some lookup from artid to animid, GetStaticTileType(item.artid) -> .miAnimID ,
this also uses one of the .mul files, GetStaticTileType -> gTileTypeLoader -> gTiledataFile -> tiledata.mul

either somewhere along the line something with the id transforms goes wrong,
or we get the right id but our graphics (src/data_anim.cpp) loader cannot access the pixels due to some file format changes in the mondains legacy extension files.

difficulty to fix the parrot=vortex and other ML-related graphics bugs is rather high, since a lot of undocumented uo behavior has to be checked (.def files), or it might involve reverse engineering the anim*.mul format further to find the problem in case of the id being correct and the problem being inside the anim-pixel-loader code.


Top
 Profile  
 
 Post subject: Re: Skybox Fix
PostPosted: Tue Aug 02, 2011 10:19 am 
Offline
User avatar

Joined: Sat Jul 04, 2009 8:52 pm
Posts: 25
Then I won't even try to fix it but thanks for the info.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users 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:  
Powered by phpBB® Forum Software © phpBB Group