Jump to content

Flexman

Members
  • Posts

    916
  • Joined

  • Last visited

Posts posted by Flexman

  1. Well....hmmm...I'm using a 4096 res map @ 10m per tile. I'm happy with the way things are. If I wanted to populate such a map with objects, without a good culling, grouping system it wouldn't be practical, a map would takes ages to load.

     

    After chatting with a couple of very nice members of the LE community the consensus was that if there's anything really needed, it's not more features, just a few fixes, examples and documentation. Documentation, documentation, documentation. Take the whole Corona thing for example, people were trying to get them working and failing until Josh stepped up and said you don't do it like that any more, do it like this.

     

    I'd love more info on vegetation data, most of my terrain is empty desert, most features are already stored as GIS data which I want to import at some point. Certainly don't want to hand-paint it all, that would take ages.

     

    As for little fixes, well....vehicles, give them brakes and or the ability to make them active/inactive. Racing games are perhaps the easiest and cheesiest to produce on a new engine and it would be easy to make one in LE now there are roads and vehicles. But it would be an incentive if you could populate your starting line with vehicles that didn't roll off the track at the start. Josh is very capable and he'll get it sorted in time I'm sure.

  2. The flashlight in the demo used "PaintEntity()" on a spotlight to apply a texture in a similar manner.

    In the Leadwerks Editor, create a spotlight and assign the material to it.

     

     

     

    example from flashlight.mat

    texture0="abstract::flashlight.dds"
    blend=LIGHT
    depthmask=0
    castshadows=0
    lighting=0
    shader="abstract::mesh_diffuse.vert","abstract::mesh_diffuse.frag"
    

  3. This is something I've been having not much fun with.

     

    As I'm using BlitzMax, the cross platform FreeJoy input module doesn't work too well with exotic input devices, like SDL, the joystick polling relies on Winmm calls which only supports a maximum of six axis. They don't support all the options you might get on fancy flight stick (e.g Saitek X52).

     

    Also XInput only supports a subset of axis which again is no good if you're wanting to cover all bases (plus the source I was looking suggests it supports 4 input devices max?).

     

    DirectInput seems to support everything including the exotic 3DConnection SpaceNagivator (which blew me away as normally it's a desk weight outside of Google Earth and Max2009). I'm just not having much fun transposing DirectInput C++ code into a manageable BlitzMax mod atm. Something is wrong with my pointer to DI interface or something. Maybe I'll start a thread in the BMax programming forum, maybe some of you geniuses can see a better way.

  4. File Name: beacontower.lua

    File Submitter: Flexman

    File Submitted: 10 Dec 2009

    File Category: Lua Scripts

     

    This LUA code is used with one of the Dexsoft radio tower models (from their industrial packs). It adds three lights and makes the top one blink at a specified interval (in millisecs) and colour.

    Can be used with any model, you'll have to edit to position the three corona locations by hand. And it's easy enough to add or remove corona.

     

     

     

    Click here to download this file

    • Upvote 1
  5. This LUA code is used with one of the Dexsoft radio tower models. It adds three lights and makes the top one blink at a specified interval and colour.

     

    But the view range isn't all that great. I was going to ask for suggestions for setting the Corona view range as I tried Lua: entity:SetViewRange( near, far, recursive ) as per the Wiki but only got an error. However the following worked:

     

    EntityViewRange(entity.antennalight[i],800,1000)

     

     

    Here's the full script if interested.

     

     

    
    dofile("Scripts/base.lua")
    
    
    function InitDialog(grid)
    base_InitDialog(grid)
    
    --custom properties
    group=grid:AddGroup( "Beacon" )
    group:AddProperty( "blinkspeed",PROPERTY_INTEGER,1000,"Blink Speed")
    group:AddProperty("beaconcolor",PROPERTY_COLOR,"","Beacon Color")
    group:Expand(1)
    
    end
    
    function Spawn(model)
    local entity=base_Spawn(model)
    entity.antennalight={}
    entity.blinkspeed = tonumber(model:GetKey("blinkspeed","1000"))
    entity.beaconcolor = Vec4(1.0,0,0,1)
    entity.lasttime = AppTime()
    entity.blinktoggle = 1
    
    for i=0,2 do
    	entity.antennalight[i] = CreateCorona(model)
    	entity.antennalight[i]:Paint(LoadMaterial("abstract::flare1.mat"),1)
    	entity.antennalight[i]:SetParent(model,0)
    	entity.antennalight[i]:SetColor(entity.beaconcolor,0)
    	SetCoronaRadius(entity.antennalight[i],1,1)
    	EntityViewRange(entity.antennalight[i],800,1000)
    
    end
    
    -- Fixed light positions on our antenna
    entity.antennalight[0]:SetPosition(Vec3(0,35,0.1),0)
    entity.antennalight[1]:SetPosition(Vec3(1.5,25.2,0.1),0)
    entity.antennalight[2]:SetPosition(Vec3(-1.5,25.2,0.1),0)
    
    
    base_SetKey("collisiontype",COLLISION_PROP)
    
    --An update function for one instance.  Declaring the function as part of the entity table allows us to use "self" for the table
    function entity:Update()
    
    	if (AppTime()-self.lasttime>entity.blinkspeed) then
    		self.lasttime = AppTime()
    		self.blinktoggle = -self.blinktoggle
    		if (self.blinktoggle>0) then
    			self.antennalight[0]:Hide()
    		else
    			self.antennalight[0]:Show()
    		end
    	end
    
    end
    
    
    end
    
    function SetKey(model, key, value)
    local entity=entitytable[model]
    if entity==nil then return 1 end
    if entity.model==nil then return 1 end
    if key=="blinkspeed" then
    	entity.blinkspeed = tonumber(value)
    elseif key=="beaconcolor" then
    	entity.beaconcolor=StringToColor(value)
    	entity.beaconcolor.w = 1
    	entity.antennalight[0]:SetColor(entity.beaconcolor,0)
    	entity.antennalight[1]:SetColor(entity.beaconcolor,0)
    	entity.antennalight[2]:SetColor(entity.beaconcolor,0)
    end
    return 1
    end
    
    
    --Update function, called during every UpdateWorld()
    function Update(world)
    if world==world_main then
    	local model,entity
    	for model,entity in pairs(entitytable) do
    		if model.world==world then
    			entity:Update()
    		end
    	end
        end
    end
    

  6. Scene: Skies high above an island, tumbling over and over, ground, sky, clouds. Rapidly spinning. Sounds of wind, a thumping heartbeat. Glimpse of an aircraft in flames breaking up in the process of crashing into the sea. Plummeting through clouds. You hear other peoples screams around you, other passengers? You remember you were on a plane, being served drinks, now you're falling to certain death, but the graphics look really great.

     

    The ground only seconds away. Impact. Black screen.

     

     

     

    (that's how I would have ended Lost in episode one. Good riddance.)

     

     

    How about...you wake up one morning, a bedroom, sunlight streams through a window (godrays turned on). But here's the twist. You find yourself transformed into a giant insect. No, no, that's a terrible idea.

     

     

    OK, you're a moisture farmer out in the desert, a tornado comes so you seek refuge inside your house but it's swept away and your transported as if by magic onto a space station inhabited by small people ruled by fear. Fear of an evil wizard. And only your knowledge of advanced weaponry (and moisture farming) can save them. No, too many assets required, but otherwise a great idea (note to self: another one for Lucas).

     

     

    A tree, in a forest, camera plays around it, it's an apple tree. Comes to look at one apple, the wind is blowing. The apple falls. Camera tracks the apple but time is slowing down. The apple falls slower, and slower. The apple never reaches the ground, it just hangs in the air, some other apples fall but they all hit the ground. Our apple doesn't. It's a special apple, ripe and juicy. OK, it's an allegory of the human condition.

     

     

    Particle physics. Sub-atomics (my fav). Scene: A conversation between two particles as they whizz around a large accelerator. One talks loudly about where he went on holiday, the other is bored, disinterested, constantly plagued with doubt and uncertainty, especially about where he is at any given moment in time. Everytime the loud one glances at him he jumps to a random position. See, it's educational. They both end up splatting into mirror images of themselves (but lady particles) and the resulting explosion of energy produces lots of little versions of themselves that flood the target chamber. Awwww.

     

     

    Well I'm out of sensible ideas.

    • Upvote 1
  7. To be realistic you need to move the world around the sun :) ( little joke - of course it looks the same, people see what their knowledge tells them they are seeing )

     

    I'm impressed by earlier efforts to make day-night cycles. I think they used a colour table for the time of day and set the sun entity (directional light) and ambient colour to some factor.

     

    Other points I noted: The directional light should fade to nothing before reaching the horizon as shadows are not that strong in low light conditions. Ambient light takes over from directional light at sunset (and vice versa at sunrise).

     

    Some used a fading skybox to show stars.

     

    Pre-computed light scattering colours would be faster. I did some work on planet atmospheric shells and calculating the light scattered through them many years ago, think it was called Rayleigh scattering.

    (edit) I just found a useful link GameDev - Atmospheric Scattering

  8. Aha, yes. To confirm, that works now. Serves me right for trying to be cleaver. It's no hardship to set it to a fixed size. I'm guessing the AABB isn't updated until a scene update which occurs in the editor environment but not when it's loading for the first time in a compiled app.

     

    That's a beer I owe you. Cheers.

  9. I have a radio tower model and created this script that creates a red Corona and places it on top of the mast. This works fine in the editor.

    But the Corona never shows in a compiled BMax program. No errors are reported in the log and the materials are loaded.

     

    Using Macklebee's controller.bmx code as a barebones test program it still won't show. Typically this sort of problem is due to missing assets from the app directory tree but the logs from both the LE Editor and my compiled programs clearly show it loading the script and assets (and I tested the controller and testscene from the same fold as the editor).

     

    Is there anything obviously wrong with this code?

     

     

    
    dofile("Scripts/base.lua")
    
    local antennalight
    
    function Spawn(model)
    local entity=base_Spawn(model)
    
    antennalight = CreateCorona(model)
    antennalight:Paint(LoadMaterial("abstract::flare1.mat"),1)
    antennalight:SetParent(model,0)
    antennalight:SetPosition(Vec3(0,model.aabb.h+0.1,0),0)
    antennalight:SetColor(Vec4(1.0,0,0,1),0)
    SetCoronaRadius(antennalight,2,2)
    base_SetKey("collisiontype",COLLISION_PROP)
    return entity
    end
    
    
    function Kill(model)
    if antennalight~=nil then
    	antennalight:Free()
    end
    end
    

     

     

     

    If I can get models to spawn coronas and light sources it will make lighting night scenes much easier.

     

    environment _atmosphere objects should work also but I had to process that in a SceneLoader to get fog and camera distance to work. I'm wondering if Corona's are another special case?

  10. I want to experiment with painting texture layers outside of the editor using Photoshop of .NET Paint.

     

    When you create a new map and paint layers this data is stored in a file named <mapname>_alpha.dds. I want to edit this and re-export it. Only some settings in the nVidia DDS export plugin will match the 65,537 kb size but when you load them into Leadwerks Editor they don't seem to work or allow editing.

     

    I've tried XRGB 32bpp unsigned (no mips). ARGB 32bpp unsigned and a few more that swap the channels about which retain the same filesize but clearly not good. I have a large map and want to imprint road and river paths from external data sources, and bake those into the map as blended textures. It would be far faster and more accurate than hand-painting.

     

    What DDS format is the Leadwerks Editor expecting and can it be made to work?

  11. If I could make a suggestion to the topic starter, add some key commands to adjust various properties such as mass, damping, (spring height etc if a vehicle) so you can fine tune how it plays so you're not always having to stop, re-edit and try again. Not only will it help you find good values for your objects behavior, but it can be great fun too. (Set the spring height of a vehicle to stupidly large values and let the Whacky Races begin).

     

     

    I didn't notice the funny gravity, I set it manually anyway but I'll have to go and check it now (everything seems to fly-drive as before).

  12. I used a mass of about 12 units for a 6 tonne helicopter which gives a pleasing result. Just scale your forces and torque appropriately.

     

     

    But to be a little off-top, I keep seeing the misconception that hammers and feathers fall at the same rate in a vacuum. Which would be true if the objects didn't have mass. But a Hammer or Piano has a substantially greater gravitational field than a feather. They would actually fall faster, just not on a scale you would notice. But it's important if you plan on throwing large objects at nearby planets.

     

    Apologies for the digression.

  13. Yes, Framewerks.SetZoom(..) if you're using Framewerk.

     

    Just to elaborate a little. Framewerk uses three render worlds, one for your scene, one for the skybox and the other for reflections. CameraZoom(...) only works for the currently active world.

     

    And the default FOV is about 90 degrees for a zoom factor of 1.0 (there's a way of calculating zoom for any desired FOV which was on the old forums, shouldn't be too hard to dig it out if required).

  14. It needs all nodes after the first to have the target property set to the next node. I'm not clear how you do that in the editor.

     

    In the SBX file, you'll notice every object has an ID# and the camera nodes specify the target as a property thusly "target0=<id>"

     

     

    Any clues how to do this in LEditor?

×
×
  • Create New...