Jump to content

Gonan

Members
  • Posts

    185
  • Joined

  • Last visited

Everything posted by Gonan

  1. Are some video games made because of dreams, if they are, how do they fare against those made from conscious thought processes. For those of use who experience dreams, do we all have an untapped resource in creativity, and all we have to do is remember what happened, and what feelings we had. Ever woken up and thought wow that was a good dream, I was.....err can't remember now , but I know it was really exciting. If I could just go back to sleep, I could find out more, and that would be really good, but you know that hardly ever works. How do we get that feeling into our video games, why do we want to get back to the exciting dream, we know its not real. Can that same feeling be driven by video games, which we also know are not real. Do we only enjoy playing what we don't fully understand, and once we achieve enlightenment we begin to loose enjoyment.
  2. Its probably to the benefit of the leadwerks community as a whole that you don't have a book on lua. you will try things for yourself, ask the community a question, get others to try and find answers or workarounds, and every one can learn either by looking through the recent posts, or searching for the same issues, the knowledge base becomes a valuable tool for the whole community.
  3. 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.
  4. 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.
  5. 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.
  6. @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.
  7. 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.
  8. I think Josh fixed the throwing LMB issue recently in the beta build.
  9. 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.
  10. 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.
  11. I'm still running Nvidia 344.75 18/11/2014 and not having issues, 347.09 23/12/2014 is available but its not on the Leadwerks recommended version yet. I'll update to 347.09 and if I get problems I'll update this.
  12. 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.
  13. 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.
  14. 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.
  15. 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
  16. I see someone else has also had this assert, however I dont have a reproducible set of circumstances that I can provide for you to re-create. I was just running around for 10 minutes on mountain loop which is a map on the workshop, without killing the crawlers that were following me, and nothing special when the assert happened.
  17. Just tried it and it worked great, added comment --skybox_texture.mat to app.lua and it then included the Skybox setting, that I had put in Scene Root.
  18. 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"
  19. 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.
  20. 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.
  21. did you get the one for Map:Load where a handle leaks 1 per reload?
  22. 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.
  23. 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
  24. I had the same issue, and just deleted the skybox entry in root, which was pointing to Josh, and readded it from my own id, and saved. Ok now.
  25. 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
×
×
  • Create New...