Jump to content

Gonan

Members
  • Posts

    185
  • Joined

  • Last visited

Posts posted by Gonan

  1. If you find the map in the leadwerks\backup folder its going to be the name you gave it plus -backupn.map where the n is a version number.

     

    just copy it back to the leadwerks\projects\whateverourprojectwas\maps folder - You can rename the maps to get the name correct . Open it if its still empty try again with an earlier version.

  2. its got to be commercial forces driving the decisions that they are making, or no driving force at all.

     

    If they spend R&D getting better results against their competitor in the DirectX arena, but fall behind in OpenGL are the going to sell more cards than their competitor or less.

     

    If OpenGL performance degrades to useless and is even worse than barely works. Should they leave the OpenGL market to their competitors, if they believe its not going to affect sales for using Directx11

     

    Think about what would you choose when buying a card.

     

    The fastest most powerfully rated graphics card on the market for use in DX11 games. Useless for OpenGL.

    or

    The most versatile rated graphics card that plays well on both DX11 and OpenGL games.

    How much faster would the first have to be, for you to decide to buy it instead of the second, assuming price was the same?

  3. You have probably switched Leadweks from beta back to release. I think josh updated something internal in the map that updates the version of the map in the beta version, which means it wont load in the release version. You either have to go back to using the beta version, or use the back up folder when you last used the map in the release.

  4. I might not use Time:Delay(10000) as it will pause your game for 10 seconds. You could be doing other useful things in the background like loading the first map. If you get the current time, add 10000 and store it in TenSecondsFromNow you could then process what you need to then check if the current time > TenSecondsFromNow, if it is let the game continue.

  5. @beo6, thanks for the alternative.

     

    In my case I only perform the check when an entity is dead.

     

    The two approaches will ideally give the same results, subtracting 1 from a total, is obviously way faster than an entity scan and totalling up each side every time one dies.

     

    The subtlety is one method catches all the ones that die and subtracts 1 from a total as part of that function, and the other counts all those that are alive and in play. As long as I remember to update the counter every time something dies or is born, or is resurrected, both methods will give the same answers.

     

    The government have the same problems with population count, people arrive, leave, born, die, countries vote for independence so could leave taking all their population with them, but every 10 years they check the totals with a census.

     

    Having both methods have their uses, just use them at the right time.

  6. You can try and make the GetEntityNeighbors.lua more efficient for your usage.

     

    The callback function WorldGetEntitiesInAABBDoCallback(entityextra) will insert entity into the global WorldGetEntitiesInAABBDoCallbackTable.

     

    if you let it default it will add every entity that has a script in range of the current entity into the table, but not itself.

     

    Assume your zombies are all in range.

    so for 5 zombies the table would be built with 4 zombies 5 times. ie 20 inserts.

    for 10 zombies the table would be built with 9 zombies 10 times, ie 90 insrters.

    for 20 zombies the table would be built with 19 zombies 20 times , ie 380 inserts.

    for 100 zombies the table would be built with 99 zombies 100 times, ie 9900 inserts.

     

    So if you select the entiries you need to process, ie you are not interested in members of the same team being added to the table, then don't insert them.

     

    In LOSW - LastOneStandingWins I use this

     

    function WorldGetEntitiesInAABBDoCallback(entity,extra)

    if entity~=extra then

    if entity.script~=nil then

    --opposing team members

    if ((entity.script.teamid==1) and (extra.script.teamid==2))

    or ((entity.script.teamid==2) and (extra.script.teamid==1))

    then

    if entity.script.health > 0 then

    -- who are alive

    table.insert(WorldGetEntitiesInAABBDoCallbackTable,entity)

    end

    end

    end

    end

    end

     

    so only opposing team members who are alive are inserted. This immediately halves the size of the tables, and other saving are made as the level progresses.

     

    Other changes made also considered that I was more likely to target an entity that was close by, so what happens if I set the radius to a quarter of its normal distance. Even fewer neighbours would be inserted, but I was going to pick someone closer to me anyway.

     

    So I performed a quick local check, and if that found nothing, I performed the full check. This two stage approach meant that as zombies are fighting, they are typically stood near their opponent. So the first check would return entries in the table. If nothing was found the second check would scan the whole area, and end up chasing another entity. If there was no entities, on the second check then there was a winner.

  7. Hi,

     

    After so many new entries have been added for the Winter Games competition, the leadwerks community could try the games and give feedback on what they like or dislike about the way the game plays, looks, or if it has any bugs.

     

    This feedback is valuable an can be used by the developer to build on the efforts already made.

     

    Some of us will be wanting to know if they should continue with their development, try changing it in some way, or abandon it and move on to a new project.

     

    Some things may be simple changes, like the change the music, or save my settings.

     

    Or much more work is required in designing an appropriate number of levels.

     

    More interaction in the gameplay.

     

    More challenge.

     

    Placement of earned bonuses being able to customise the maps.

     

    Spending points on items from NPCs.

     

    Graphics, physics, multiplayer improvement required.

     

     

    If users enjoy playing the game, would they pay to play it if it was on the store, or would they only play if it was free, and would the support it being Greenlit.

    • Upvote 1
  8. For a good source of code using tables, refer to the GetEntityNeighbors.lua which can be found in Scripts Functions.

     

    Its one of the more complex pieces of LUA code in leadwerks, but if you take your time to follow what it does you can make some useful functions.

     

    Here is one pair of additional functions that I used in LastOneStandingWins to get the number of zombies and crawlers still alive in the level. It uses a axis aligned bounding box 100m from the centre in all directions, and calls the call back for each entity found. In this simplifed callback fundtion the table processing has been removed, as its not required.

     

    WorldGetEntitiesInAABBDoCallbackTable = nil

    GetEntityNeighborsScriptedOnly=false

    NumCrawlers=nil

    NumZombies=nil

     

    function WorldGetEntitiesInAABBDoCallbackTeamAlive(entity)

    if entity~=nil then

    if entity.script~=nil then

    --team members

    if (entity.script.teamid==1) then

    if entity.script.health > 0 then

    -- who are alive

    NumCrawlers = NumCrawlers + 1

    end

    elseif (entity.script.teamid==2) then

    if entity.script.health > 0 then

    -- who are alive

    NumZombies = NumZombies + 1

    end

    end

    end

    end

    end

    function GetTeamScore(entity)

    -- How many members of the specified team are alive

    local aabb = AABB()

    local p = Vec3(0,0,0) -- centre of world

    NumCrawlers=0

    NumZombies=0

     

    aabb.min = p - 100

    aabb.max = p + 100

    aabb:Update()

    entity.world:ForEachEntityInAABBDo(aabb,"WorldGetEntitiesInAABBDoCallbackTeamAlive")

    return NumCrawlers,NumZombies

    end

     

    its driven from MonsterAI.lua

     

    in SetMode(mode) when the mode is "dead" and in Start() with this line of code.

     

    App:SetScores(GetTeamScore(self.entity))

     

     

    This Function is added in App.lua

     

    function App:SetScores(numCrawlers,numZombies)

    if numCrawlers == nil then

    StartingCrawlers = 1000

    else

    StartingCrawlers = numCrawlers

    end

    if numZombies == nil then

    StartingZombies = 1000

    else

    StartingZombies = numZombies

    end

    end

     

    You can also tweak the way the AI works by updating GetEntityNeighbors, for instance only storing opposing team members in the table,and setting a much smaller distance, so the stored entities are localised. to the current entity. This means a smaller table and therefore processing faster and more efficiently. If this returns no entries scan again but with a much bigger distance that encompases the whole map, and this typically only gets called as the area empties. Doing this allowed me to have over 20 per team and keep up a reasonable frame rate early in each level, and use Lua script.

    • Upvote 1
  9. I noticed, there is a download count on downloads part of the website, but the games have a views count.

     

    Can a downloads counter be added to the Games site? There is a download count on the Steam Workshop that I liked, but we can no longer publish games there, from beta 3.3.

     

    Anyone else think this is a good idea, sorry there is no dislike if you don't. But that's another option that could be useful.

    • Upvote 2
  10. I added this function to Noise.Lua

     

    function Script:CleanUp()

    if self.source ~= nil then

    self.source:Stop()

    end

     

    end

     

    and before reloading maps in app.lua i make sure my sound (music and announcements), which are not part of the map, but have been added to a pivot created in App.Lua, are cleared up.

     

    --Handle map change

    if changemapname~=nil then

     

    --Clear all entities

    if self.my1a ~= nil then

    if self.my1a.script ~= nil then

    self.my1a.script:CleanUp()

    end

    self.my1a = nil

    end

    if self.crawlerbetplaced ~= nil then

    if self.crawlerbetplaced.script ~= nil then

    self.crawlerbetplaced.script:CleanUp()

    end

    self.crawlerbetplaced = nil

    end

    if self.zombiebetplaced ~= nil then

    if self.zombiebetplaced.script ~= nil then

    self.zombiebetplaced.script:CleanUp()

    end

    self.zombiebetplaced = nil

    end

    self.world:Clear()

     

     

    I then reload the next map and re-create the pivots and attach the sounds like this.

     

    if self.my1a == nil then

    self.my1a = Pivot:Create()

    end

    self.my1a:SetScript("Scripts/Objects/Sound/Noise.lua")

    self.my1a.script:SetSoundFile("Sound/Music/my1a.wav")

    self.my1a.script:SetUp() -- complete initialisation and play.

     

     

     

    I had to make some more functions in noise.lua

     

    function Script:Start()

    end

    function Script:Initialise()

    self.source = Source:Create()

    self.source:SetVolume(self.volume/100)

    self.source:SetPitch(self.pitch)

    self.source:SetLoopMode(self.loop)

    self.source:SetRange(self.range)

    self.source:SetPosition(self.entity:GetPosition(true))

     

    end

     

    function Script:SetUp()

    local sound = Sound:Load(self.setsoundfile)

    if sound~=nil then

    self.source:SetSound(sound)

    if self.playing==true and self.enabled==true then

    if App:GetMusic() then

    self.source:Play()

    else

    self.playing=false

    end

     

    end

    sound:Release()

    sound=nil

    end

    end

    function Script:Play()--in

    if self.enabled and self.playing == false then

     

    self.source:Play()

    self.playing = true

     

    end

    self.component:CallOutputs("Play")

    end

    function Script:Enable()--in

    self.enabled=true

    end

    function Script:Disable()--in

    self.enabled=false

    end

    function Script:UpdatePhysics()

    if self.loop then

    if App:GetMusic() then

    self:Play()

    else

    self:Pause()

    end

    else

    self:Play()

    end

    end

    function Script:Pause()--in

    self.source:Pause()

    self.playing = false

    end

    function Script:SetSoundFile(soundpath)

    self.setsoundfile = soundpath

    self:Initialise()

    end

    function Script:OneHit()

    self.playing=false

    self.loop=false

    end

     

     

    OneHit stops the sound looping.

    The code in Start() has been split in 2 and the first part put in an Initialise function.

    The second half put in SetUp()

    This gives me the control to make the sound occur when other functions of app.lua are being processed.

     

    I also avoid using the flowgraph editor, relying on code and calls to App: functions.

    I can now add more maps without having to add the music and announcer sounds or pivots to each map.

  11. I had a look at the corridor code, and can appreciate that its quite complex, my initial thoughts were that the value for m_maxPath had been set to too low a value.

     

    MoutainLoop is quite large in the number of details in the landscape. The navmesh takes several minutes to generate.

     

    So I was trying to understand the coding, a corridor is created from a starting point to a target, this covers a sequence of polygons. The sequence can change over time, as either end can move.

     

    So thinking about only having this happen in the Mountain loop map, where the crawlers were chasing my fps character. And where I can go to places where the navmesh doesnt go, but the crawlers can only stay on the navmesh, until the get to a short range. I was running in a circle around a depression in the ground when the last one occurred, after I had run into the depression. Some of the area is off the navmesh, the crawlers would follow a path on the navmesh, to get as close as the could, then if they were in range, would directly traverse to my position. Would this have added an extra polygon to the corridor, and taken it over the limit on m_maxPath.

     

    Compare this with LastOneStandingWins, where I have not seen this happen. 1) the map is much simpler and only takes seconds to build the navmesh, and 2 the only combatants are both using the navmesh to chase each other, and would therefore generally stay on the navmesh, or fall off the edge.

  12. Are you running windows or linux?

    The requirements for Leadwerks for windows is OpenGL 4.0 compatible card, and yours is 4.2 so if your running windows the card should be fine.

     

    For linux and nvidia cards need to use the nvida driver. There is a warning in the Leadwerks system requirements about using intel drivers as they dont support OpenGL 4.0 on linux.

     

    If you can say what your OS and driver version is, you are more likely to get a relevant answer, there are some posts in the forums about supported drivers too.

    http://www.leadwerks.com/werkspace/page/drivers

  13. I have Nvidia Shadowplay (beta), running, just hit alt 0 and the last 2 minutes of my primary full screen is dumped out to an mp4 file in the videos folder. Useful for keeping awesome moments from games that you are playing just after they happen.

     

    I think it s available for 650 and higher Nvidia cards. Not noticed any issues on fps since I started it up a week ago.

    • Upvote 1
  14. As all scripts are scanned and exported, and programmatically generated content is not exported, can we create a myexports.lua.

    Even if myexports.lua isn't attached to any maps or entities I presume it will still get scanned and exported.

     

    So my question is what is the minimum code that I need to put into myexports.lua to make the export scanner include content that has been programmatically referenced elsewhere in the program.

    Do I have to code every file used, or can I code a path to include all files, and will that include subfolders and their files too?

     

    eg. if subfolders were not automatically added. Would the following work or would every programmatically referenced file need to be listed.

     

    -- helper for publishing

     

    local soundexp="Sound/Player" -- entire contents of Player folder added to export

    local soundexpFootsteps="Sound/Footsteps"

    local soundexpFottstepsConcrete="Sound/Footsteps/Concrete"

    local zombiesounds="AddOns/Zombie Character Pack/*.wav" -- just the .wav files added to the export

    -- or would this be required to specify each individual file

    local zombiesounds1="Addons/Zombie Character Pack/alert.wav"

    local zombesounds2="Addons/Zombie Character Pack/idle.wav"

  15. Hi Hydenmango,

     

    http://www.leadwerks.com/werkspace/topic/11534-deleting-gui-text-input/

     

    I had an empty map which had a camera and nothing else, after the beta update i got the above some new improved behaviour described in the link above, and I also noticed that the only entity in the scene was now showing as a light, not a camera.

     

    Of course I could have mistakenly added a light instead of a camera, and its just a coincidence.

  16. Something happened with after yesterdays beta, the text displays on the empty map, have sharpened up and are no longer blocky, and the grey colour has gone for the deleted text, and is now black, so I guess its been fixed.biggrin.png

  17. So my first display screen is an empty map with a camera.

     

    On it I'm setting up the HUD, and giving some basic instructions using white text on black background.

     

    I prompt for the user to enter their initials, and press return to start.

     

    I display the initials as they hit each key A-Z.

     

    The problem I'm having though, is if the user keys the wrong initials, and presses delete or backspace, I need to blank out the initials that have been displayed with DrawText.

     

    The problem is the output on the display is cumulative. So displaying blanks over the initials changes nothing.

     

    So I thought, I know , Ill be really clever and use SetColor(0,0,0,1) to redraw the old initials in black before i clear them down.

     

    (I was implementing the backspace and delete key to completely reset all the initials typed in, not just the last key)

     

    Unfortunately the SetColor(0,0,0,1) just writes grey text on black, its better than nothing, but I was wondering how anyone else would black out the initials typed in error.

  18. I had got to that point too, by not having any scripts attached, and then turning off the character controller, making it rigid physics, and found the crash no longer happened. But it was eliminating too much of the problem's characteristics to be useful to debug further.

     

    It brought back memories of algebra from 40 years ago, when I would work out 0 == 0

  19. http://www.leadwerks.com/werkspace/topic/11458-maxcharacterstest/

     

    Hi Josh,

     

    I've been having a problem with my game crashing, after reloading a map, or sequence of maps.

     

    After creating a couple of demos, of the problem, the community (Thanks nick.ace) has found a cool work around. See Link above.

     

    This involves replacing in App.Lua

     

    self.world:Clear()

     

    with

     

    self.world:Release()

    self.world=World:Create()

     

    and a creating a new world to load the next map into.

     

    This work around means I am no longer restricted to 3 or 4 levels when writing my game.

     

    Whilst the issue may be in my code, you may find that world:Clear() leaves something behind, or doesn't reset something.

     

    I will use the work around until a permanent fix is found.

     

    Thanks

    • Upvote 1
×
×
  • Create New...