-
Posts
397 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by flachdrache
-
Can Leadwerks handle [input large number] of blocks?
flachdrache replied to Jardar's topic in Programming
.. since which version is that true ? PS: oh nose - we now got an ninja smile -
- move it out of program files, use c:Leadwerks Engine SDK (or such simple) - if its not the demo SDK, run the updater on the new folder again - have all leadwerks sdk in that folder (dont copy its tools around - because of ini, config files) - reinstall openAL + if you move folders - you might have to check your system privileges for the SDK folder, as an administrator
-
As a starter you should pick the latest version since you can get the most help with it ... there are always these ghosts you have to overcome though.
-
Physics: How does unity calculate drag?
flachdrache replied to Andy Gilbert's topic in General Discussion
Hey - iam puzzled as well since its a nice to have ... the guess i made was geared forward to gamelibs implementation which i guess just hooks the bodys mass center to a joint ... momentum usually will do the rest for us imho. I mean, its a physics lib if using joints all we can control is joint stiffness afaik. PS: i just saw your "The good news about computers ..." quote ... dont mind, i just meant that we have to fight for our hard disk drives now - or we will get pre-configured. (censored) @Engineer Ken - dont you just try to outsmart newton lib ?! -
Physics: How does unity calculate drag?
flachdrache replied to Andy Gilbert's topic in General Discussion
ps : your statement is wrong - as soon as the cloud`s going to reconfigure your pc config to better read its data youll know what i mean. -
Physics: How does unity calculate drag?
flachdrache replied to Andy Gilbert's topic in General Discussion
For what is it used then ?! ... you should forget about the "correct" way in computer games since its stated as being "allways" to expensive to calculate - e.g. if you want/can use joints controll its rigidity and let it add up to object mass ... but you know what i mean. -
[SOLVED] Frustration with trying to convert .X file
flachdrache replied to Pixel Perfect's topic in Game Artwork
Great that it worked but ... "blarg". -
[SOLVED] Frustration with trying to convert .X file
flachdrache replied to Pixel Perfect's topic in Game Artwork
one of the several reasons why my players wear dusk masks ... you road the fpsWeapon artikle ?! -
That might was planned but Web 2.0 is right now ... while HTML5 is 2years away.
-
The first two links you posted do pretty well describe the difference between current and new standarts in terms of layout ... everything used to be a treenode which might be going to be more open "at a glance".
-
Web2.0 is more a technical term - look at html5. If one is going to write a quote, one writes a quote and not a small headline in quotes. PS : iam out-of-business for quit some time now - but i believe its all about being "barrier-free" ... it can be better interpreted/translated.
-
i dont mind no more tbh - as i was new with le, with a c/c# background jumping into lua, it would have been pure chaoz to skim through pages of bmax to find an answere about a certain topic ... but i would think the other way around e.g. the forum software p.m.`s topic starters to close the topic with the solution if 14 days passed w/o an update. People started to do this by themself by adding a "solved" to the topic title. tbh - currently its often just random guessing under undefined headlines. LEadwerks forum is kind of strange - i mean we write computer games ... and if a question pops up three days before one gets there he/she/it cant do anything about it or have to wild guess themself with the current set of knowledge ... kind of doing w.i.p. answers or two guessers are better then one. ... having a better search option could deal with all that e.g. search solved/not-solved topics to begin with.
-
tbh. i texture the whole model with an "invisible.jpg" and texture the visible faces with its real texture(s) afterwards - so, leadwerks engine "does not" process them but i still have these faces in the model for several reasons ... flat plane is what is called a "simple patch mesh" in the doom3 generation of map design tools which was introduced as "curved-sufaces" in quake3arena, its spline based afaik - this plus spherical, planar and cylindrical UVW mapping would be great. and selecting surfaces by texture, selecting all brushes inside another brush volume.
-
Hmmm, i know crazybump, its great for photo sourced textures but it sometimes makes the look of "overinflated" - however you could get the depthmaps from it and extract the models surfaces with it using zbrush or something similar ... basically for what the tesselation thing is good for. ;p
-
Load the diffuseMap into the alphaChannel (A8R8G8B8) of the normalMap and use some such settings : ...// specular=0.4 bumpscale=1.0 gloss=0.8 //shader="abstract::mesh_diffuse_bumpmap.vert","abstract::mesh_diffuse_bumpmap_specular_detail.frag" shader="abstract::mesh_diffuse_bumpmap.vert","abstract::mesh_diffuse_bumpmap_specular.frag" shadowshader="abstract::mesh_shadow.vert","" If you send me one of your diffuse textures i could figure some workflow for you using TheGimps normalMap plug-in (not the nvidia one). hth, low
-
... and they are harder to hit e.g. one bullet three hits But thats for what group leaders are good for - the grunts do move relative to the leader.
-
right - i just mean that in old school games if the designer throws enemy at the player the player got used to look right behind him/Her because yesterday`s ai might do walk just in straight lines ... by offsetting the approach, the player is challenged to pay more attention to the surroundings, enemy behavior he already has experienced etc.
-
Welcome in the wonderfull world of ai debugging - you can spend a lifetime with this. I actually cant say anything about it so far ... but the shortest path aint always the smartest however - will work for zombies ( see you = yummy yummy) but soldiers etc. might move perpendicular to the player movement while they are still hidden to the player ... well, dont know how to describe in english - i mean approaching tactical. PS: iam a fan of building the node graph from the polygon center of the navmesh however. Still the same area but lowers the need of tweaking the agents radius to not get stuck. But its used the way it is because its way more optimal performance wise i guess. nice work anyways so far.
-
Whoops, the mesh.vert need to have "cubecoord" defined of course and its content should look somwhat like this ... // ... texcoord0=gl_MultiTexCoord0.xy; texcoord1=gl_MultiTexCoord1.xy; //#ifdef LW_CUBEMAP cubecoord = modelvertex.xyz - cameraposition; cubecoord = reflect( cubecoord , normalize(nmat * gl_Normal.xyz) ); //#endif nmat = gl_NormalMatrix * nmat; // ...
-
Hey, i made a small modification to the early released "river node" ... or the river.frag to be precise. You most likely want to build roads as usual, carve its river beds with it and replace the road material with the following. the material file : color=1,1,1,0.85 texture0="riverwater04_color.dds" // diffuse texture1="riverwater03_nm.dds" // normal texture2="tag::rendercolor" texture3="tag::renderdepth" texture4="river_UnderwaterCube.dds" // diffuse or ambient cubemap shader="abstract::mesh_diffuse_bumpmap.vert","abstract::river.frag" zsort=1 depthmask=0 bumpscale=50 cullface=0 the "river.frag" : #extension GL_ARB_draw_buffers : enable #define LW_DIFFUSE texture0 // added - colormap #define LW_CUBEMAP_DIFFUSE texture4 // added - cube surface map #define LW_BUMPMAP texture1 #define LE_REFRACTION texture2 #define LE_DEPTHBUFFER texture3 uniform vec3 cameraposition; uniform vec2 buffersize; uniform vec2 camerarange; include "abstract::greyscale.txt" include "abstract::DepthToZPosition.frag" // added #ifdef LW_DIFFUSE uniform sampler2D LW_DIFFUSE; #endif #ifdef LW_CUBEMAP_DIFFUSE uniform samplerCube LW_CUBEMAP_DIFFUSE; #endif // -- #ifdef LW_BUMPMAP uniform sampler2D LW_BUMPMAP; #endif #ifdef LE_REFRACTION uniform sampler2D LE_REFRACTION; uniform sampler2D LE_DEPTHBUFFER; uniform float refractionstrength = 0.01; #endif varying vec3 vertexposition; varying vec3 T,B,N; varying vec2 texcoord0; varying vec2 texcoord1; varying vec3 cubecoord; varying vec4 modelvertex; varying vec4 fragcolor; float fOcclusionShadow = 1.0; uniform sampler2D texture14; uniform float terrainsize; uniform vec3 terrainscale; uniform float bumpscale; uniform float specular; uniform float gloss; //Terrain color map uniform sampler2D texture12; uniform float apptime; void main(void) { vec4 diffuse = fragcolor; vec3 normal; float shininess = 0.0; vec2 texcoord=texcoord0;// only use this because of parallax mapping float selfillumination = 0.0; //mod texcoords for diffuse map - //rivernodes might cant deal with anglemod it seams ... texcoord.y += apptime / 20000.0; vec2 terraincoord; float terrainresolution; #ifdef LW_DIFFUSE // added diffuse *= texture2D(LW_DIFFUSE,texcoord); #endif #ifdef LW_CUBEMAP_DIFFUSE // added diffuse = vec4( pow(diffuse.xyz, 1.0-(textureCube(LW_CUBEMAP_DIFFUSE, cubecoord).xyz)), diffuse.w); #endif normal = N; #ifdef LW_BUMPMAP vec4 bumpcolor = texture2D(LW_BUMPMAP,texcoord); bumpcolor += texture2D(LW_BUMPMAP,vec2(texcoord.x+0.5,texcoord.y+apptime / 20000.0)); bumpcolor /= 2.0; normal = bumpcolor.xyz * 2.0 - 1.0; normal.z /= bumpscale; normal = T * normal.x + B * normal.y + N * normal.z; normal = normalize(normal); #endif #ifdef LE_REFRACTION diffuse.a=0.25; vec4 refractionvector = vec4( gl_FragCoord.x/buffersize.x, gl_FragCoord.y/buffersize.y, gl_FragCoord.z, 1.0 ); float backgrounddepth=texture2D(LE_DEPTHBUFFER,gl_FragCoord.xy/buffersize).x; backgrounddepth=DepthToZPosition(backgrounddepth); float foregrounddepth=DepthToZPosition(gl_FragCoord.z); float rmix = clamp((backgrounddepth-foregrounddepth)/1.0,0,1); vec4 refractionvector2 = refractionvector + refractionstrength * vec4(normal,0.0) * rmix; backgrounddepth=texture2DProj(LE_DEPTHBUFFER,refractionvector2).x; diffuse = diffuse * rmix + vec4(1) * (1.0-rmix); vec4 transparency; if (backgrounddepth>gl_FragCoord.z) { backgrounddepth=DepthToZPosition(backgrounddepth); transparency = texture2DProj(LE_REFRACTION,refractionvector2); if (rmix<1.0) { transparency = transparency * rmix + (1.0-rmix) * texture2DProj(LE_REFRACTION,refractionvector); } diffuse = transparency * diffuse; } else { diffuse = texture2DProj(LE_REFRACTION,refractionvector)*diffuse; } #endif vec3 adjustednormal = normal*0.5+0.5; float adjustedgloss = gloss; //Diffuse gl_FragData[0] = diffuse; gl_FragData[1] = vec4(adjustednormal,diffuse.w); gl_FragData[3] = vec4(0,0,0,diffuse.w); shininess=clamp(shininess,0,1)*0.5; gl_FragData[2]=vec4(shininess,gloss,0.0,diffuse.w); } note : texture2="tag::rendercolor" texture3="tag::renderdepth" do need to be present and unobstructed too. e.g. on surface, model construction : local world=CurrentWorld() SetWorld(fw.transparency.world) self.rivermesh=CreateMesh(nil) SetWorld(world) ... should all be self-explanatory - hf.
-
If you get the "2003ResKit" for windowsXP - from microsoft.com, youll find a tool called "robocopy.exe". It is used to mirror/backup folders from HDD to USB ( or other hard devices ) ... i prefer local backups over internet dropBoxes because one of my ISP managed to leak edited photos i made to the public once ( one showing me slayed to death ) - oh, they where on the server but not on the website ... Anyways, if you give your USB drive a fixed drive letter ( in computer administration - data drives ) you can mirror folders and dont loose / get a new name for the drive on next boot ... command line is like : C:\XPTools\Tools\2003ResKit\RoboCopy.exe "C:\DevLab01\Le23DevDemo\AssetData" "Z:\back_projects\AssetData" /MIR I suggest to give it a real name and dont let the system call it "1" or the ms media player might synchronize it to death while confusing USB drives with Mp3 players. suggestions ?
-
However, if you use indeed cubes i might would try to have pre defined sets of textured cubes and use a position(s) texture to arange the already textured cubes properly.
-
You could write an "alphaRamp" shader which blends the textures based on the vertexcolor alpha value, which means 25% rockTexture, 50% sandTexture, 75% grass1Texture, 100% grass2Texture - while blending happens in between. You could do that based on terrain height too, by setting its vertex color in the range of Y using rgb - as above. Here is how i have done that in the pixelshader of my "ScarletFever" engine ... float4 pixel = tex2D(IN.mask, IN.baseCoord); float4 color0 = float4(0, 0, 0, 0); if(pixel.r) { float4 skinRock = tex2D(IN.texRock, IN.tCoord) * pixel.r; color0 += skinRock; } if(pixel.g) { float4 skinGrass = tex2D(IN.texGrass, IN.tCoord) * pixel.g; color0 += skinGrass; } if(pixel. { float4 skinSnow = tex2D(IN.texSnow, IN.tCoord) * pixel.b; color0 += skinSnow; } if(pixel.a) { float4 skinDirty = tex2D(IN.texDirty, IN.tCoord) * pixel.a; color0 += skinDirty; } OUT.col = color0; ... i have never done that but messing up the inRGB sampler with a perlin noise filter could add some additional variation. PS: the early version, in my XNA engine, was heavily based on these tutorials. hth
-
a simple Vector question (velocity to rotation)
flachdrache replied to AnniXa's topic in General Discussion
You most likely dont need to calculate that since Le is all "entity-based" ... you simply want to set the position / rotation of your bolt / bullet to the position / rotation of the body or set its complete EntityMatrix. I took "all" the commands i would need to build game-subsystems from the command list and wrote samples for it. It doesnt help much with integration the game-engine itself but game-mechanics can be extracted from it. here is some, slightly changed, script metraton posted (dont know how to write that name though) --stuff which should be part of LE --the best working round function, works also for negative idp (written by Robert Jay Gould) function round(num, idp) return tonumber(string.format("%." .. (idp or 0) .. "f", num)) end BLEND_NONE=0 BLEND_ALPHA=1 --end of stuff which should be part of LE local width=1920 local height=1080 require("Scripts/constants/collision_const") require("Scripts/constants/engine_const") require("Scripts/LinkedList") require("Scripts/filesystem") require("Scripts/math/math") require("scripts/classes/bullet") if fw==nil then --we are not in Editor RegisterAbstractPath("") Graphics(800,600) fw=CreateFramework() scene=LoadScene("abstract::Actors_obstacleDM1.sbx") scene:SetCollisionType(COLLISION_SCENE) TFilter() AFilter() SetHDR(true) SetSSAO(true) SetBloom(true) standalone=1 end --Variables dx=0.0 dy=0.0 camerapitch=0.0 camerayaw=0.0 move=0.0 strafe=0.0 cameraheight=1.9 --ScrennshotBuffers local buffer=CreateBuffer(width,height,BUFFER_COLOR) if buffer==nil then Notify("Failed to create buffer!",1) return end local buffer2=CreateBuffer(width,height,BUFFER_COLOR) if buffer2==nil then Notify("Failed to create buffer!",1) buffer=nil return end --array of "info_playerstart" ... classname --lobby might use different spots. local playerstart = nil playerstart = scene:FindChild("playerstart") --Create a player controller controller=CreateController(1.8, 0.46, 0.25, 45) controller:SetCollisionType(COLLISION_CHARACTER,0) controller:SetMass(10) SweptCollision(controller, 1) if standalone==1 then if playerstart ~= nil then controller:SetPosition( playerstart:GetPosition() ) else controller:SetPosition(Vec3(0,20,0)) end else controller:SetPosition(fw.main.camera.position) end camerapitch=fw.main.camera.rotation.x camerayaw=fw.main.camera.rotation.y+180 controller:Move(Vec3(0,-0.9,0)) local gunscale=0.6 local vwep = LoadMesh("abstract::vwep_hands.gmf") LoadMesh("abstract::vwep_gun.gmf",vwep) vwep:SetParent(fw.main.camera,0) vwep:SetPosition(Vec3(-0.18*gunscale,-0.03*gunscale,0.37*gunscale),0) vwep:SetScale(Vec3(0.04*gunscale,0.04*gunscale,0.04*gunscale)) local gundisplayposition = vwep:GetPosition() sound_gunshot = LoadSound("abstract::gunshot.ogg") source_gunshot = CreateSource(sound_gunshot) source_gunshot:SetVolume(0.5) vwep :SetShadowMode(0,1) local displayposition=Vec3(-0.26/2.0,-0.03,0.19) local muzzleflash = CreatePointLight(3) muzzleflash:SetParent( vwep ) muzzleflash:SetColor(Vec4(1,0.6,0.0,1.0)) muzzleflash:SetPosition( displayposition ) muzzleflash:SetShadowMode(0) HideMouse() MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2) FlushKeys() FlushMouse() local pick local camera = fw.main.camera local remainingtime local starttime=AppTime() local gameduration=2--length of game in minutes local gamemode=0 gunpos = vwep.position:Copy() local smoothedgunswayamplitude= 0.0 local smoothedgunswayspeed = 0.0 local guntime = 0.0 local recoil = 0.0 local lastfiretime=0.0 local smoothrecoil=0.0 local swaydamping=0.0 local smoothswaydamping=0.0 local lightsmoothing =0.0 local gunlight = 0.0 --Flashlight flashlight = {} flashlight.light = CreateSpotLight(8) flashlight.light:Hide() flashlight.sound_switch = LoadSound("abstract::switch.wav") flashlight.state=0 flashlight.light:SetConeAngles(30,35) flashlight.light:SetRotation(Vec3(5,0,0)) flashlight.light:SetShadowmapSize(512) flashlight.light:Paint(LoadMaterial("abstract::flashlight.mat")) function flashlight:SetState( state ) if state~=self.state then self.state=state if state==0 then self.light:Hide() else self.light:Show() end if self.sound_switch~=nil then self.sound_switch:Play() end end end function ShootBullet( position, direction ) -- local speed=100.0 -- local pick = LinePick( position, Vec3(position.x+direction.x * speed) ) end function DrawHUD(contr) SetBlend(BLEND_ALPHA) DrawText("pos: "..round(contr.position.x,3)..","..round(contr.position.y,3)..","..round(contr.position.z,3),1,FontHeight()*5) DrawText("rot: "..round(contr.rotation.x,3)..","..round(contr.rotation.y,3)..","..round(contr.rotation.z,3),1,FontHeight()*6) SetBlend(BLEND_NONE) end --main function while KeyHit(KEY_ESCAPE)==0 do jump=KeyHit(KEY_SPACE)*6.0 if controller:IsAirborne()==1 then jump=0 end local time = AppTime()/3200.0 local frame = time*(179.0-96.0)+96.0 frame=Clamp( frame, 96, 179 ) vwep:Animate(96,1,0,1) --Camera look gx=Round(GraphicsWidth()/2) gy=Round(GraphicsHeight()/2) dx=Curve((MouseX()-gx)/4.0,dx,3.0/AppSpeed()) dy=Curve((MouseY()-gy)/4.0,dy,3.0/AppSpeed()) MoveMouse(gx,gy) camerapitch=camerapitch+dy camerayaw=camerayaw-dx camerapitch=math.min(camerapitch,89) camerapitch=math.max(camerapitch,-89) fw.main.camera:SetRotationf(camerapitch,camerayaw,0,1) movespeed=6 movesmoothing=10 if controller:IsAirborne()==1 then movesmoothing=200 end --Player movement move=Curve( (KeyDown(KEY_W)-KeyDown(KEY_S))*movespeed,move,movesmoothing) strafe=Curve( (KeyDown(KEY_D)-KeyDown(KEY_A))*movespeed,strafe,movesmoothing) --Use objects if KeyHit(KEY_E)==1 then pick=CameraPick(camera,Vec3(GraphicsWidth()/2,GraphicsHeight()/2,2.0),0,0) if pick~=nil then repeat if pick.entity:GetClass()==ENTITY_MODEL then break end pick.entity=pick.entity.parent until pick.entity==nil if pick.entity~=nil then pick.entity:SendMessage("use",controller,0) end end end --crouching if KeyHit(KEY_C)==1 then if controller:IsCrouched()==1 then crouch=0 cameraheight=1.7 else crouch=1 cameraheight=0.85 end end --Update controller --controller:Update(camerayaw,move,strafe,jump,40,10) controller:Update(camerayaw,move,strafe,jump,40,10,crouch) fw:Update() if KeyHit(8)==1 then dofile("GUIindex.lua") end if KeyHit(KEY_F)==1 then flashlight:SetState(1-flashlight.state) end --Position camera camera:SetPositionf(controller.position.x,controller.position.y+cameraheight,controller.position.z,1) time=AppTime() gunfirefrequency=80 gunswayspeed=0.001*20.0 gunoffset = gunpos:Copy() gunswayamplitude = 0.02 if KeyDown(KEY_W)==1 or KeyDown(KEY_D)==1 or KeyDown(KEY_A)==1 or KeyDown(KEY_S)==1 then gunswayamplitude = 0.03 gunswayspeed=0.005*20.0 end smoothedgunswayamplitude = Curve( gunswayamplitude, smoothedgunswayamplitude, 8.0 ) smoothedgunswayspeed = Curve( gunswayspeed, smoothedgunswayspeed,8.0 ) if smoothrecoil<0.001 then guntime = guntime + AppSpeed() * smoothedgunswayspeed * math.max(0.0,1.0 - smoothswaydamping) end gunoffset.z = gunoffset.z - smoothrecoil * 0.05 smoothedgunswayamplitude = smoothedgunswayamplitude * (1.0 - smoothswaydamping) gunoffset.x = gunoffset.x + math.sin( guntime ) * smoothedgunswayamplitude * gunscale gunoffset.y = gunoffset.y + (1.0-math.cos( guntime*2.0 )) * 0.005 * gunscale * math.min(1.0,1.0 - smoothswaydamping) vwep:SetPosition( gunoffset ) recoil = recoil-0.1 swaydamping = math.max( swaydamping - 0.05, 0.0 ) recoil = math.max(recoil,0.0) smoothrecoil=Curve(recoil,smoothrecoil,3.0) smoothswaydamping = Inc( swaydamping ,smoothswaydamping,0.01 ) gunlight = math.max( gunlight- 0.2, 0.0 ) lightsmoothing =gunlight-- Curve(gunlight,lightsmoothing,8.0) muzzleflash:SetColor(Vec4(1.0*lightsmoothing,0.6*lightsmoothing,0.0,1.0)) if lightsmoothing <0.01 then muzzleflash:Hide() end if MouseDown(1)==1 then if AppTime()-lastfiretime>gunfirefrequency then recoil = 1.0 lastfiretime=AppTime()+math.random(0,20) gunswayspeed=0.0 gunlight = 1.0 source_gunshot:Play() source_gunshot:SetPitch(1.0 + (math.random()-0.5)*0.05 ) swaydamping = 1.0 muzzleflash:Show() CreateBullet(vwep:GetPosition(1) , fw.main.camera.mat:K():Scale(300)) end end if MouseHit(2)==1 then phyproj = CreateBodyBox(1,1,1) projectile = CreateCube(phyproj) projectile:SetColor(Vec4(math.random(0,255)/255,math.random(0,255)/255,math.random(0,255)/255,1)) phyproj:SetMass( 1 ) phyproj:SetCollisionType(1,0) local V = TFormVector(Vec3(0, 0, 2), fw.main.camera, nil) V = Vec3(fw.main.camera.position.x + V.x, fw.main.camera.position.y + V.y, fw.main.camera.position.z + V.z) PositionEntity(phyproj, V, 0) RotateEntity(phyproj, EntityRotation(fw.main.camera, 0), 0) phyproj:AddForcef(0, 100, 1500, 0) end UpdateBullets() flashlight.light:SetPosition(fw.main.camera:GetPosition(1)) flashlight.light:SetRotationf( CurveAngle( fw.main.camera.rotation.x, flashlight.light.rotation.x, 3.0/AppSpeed() ), CurveAngle( fw.main.camera.rotation.y, flashlight.light.rotation.y, 3.0/AppSpeed() ) ) flashlight.light:Movef(-0.07,-0.04,0.02) fw:Render() -- screenshot : note the second fw:Render() if KeyDown(KEY_F12)==1 then SetBuffer(buffer) fw:Render() SetBuffer(buffer2) DrawImage(GetColorBuffer(buffer),0,0,buffer:Width(),buffer:Height()) SetBuffer(BackBuffer()) SaveBuffer(buffer2,"screenshot.png") end DrawHUD(controller) Flip(0) end buffer=nil buffer2=nil controller:Free() vwep:Free() ShowMouse() hth