Jump to content

Leopard20

Member
  • Content Count

    762
  • Joined

  • Last visited

  • Medals

Everything posted by Leopard20

  1. At this point a Discord channel is not necessary, but once the mod reaches near completion I will. Not much for the AI themselves, but the mesh generation will definitely need a lot of memory because I plan on adding cached meshes to avoid unnecessary calculation time during the mission (mesh generation for a 20mx20m building may take from 0-1 to 3-4 seconds, depending on how many floors and "rooms" it has, but "mesh translation" from a cached mesh takes up to 1s for my biggest mesh yet, the USS Freedom, which takes about a minute to mesh in real time). I haven't done the caching yet, but I expect I'll need ~100-200 MBs for the vanilla objects alone (for reference, the USS Freedom needs about 8 MBs of RAM). If you want to use other mods such as CUP, IFA3, Unsung, etc. at the same time, the total size may reach up to 1 GB. Yes this one is likely. But not too high as one might expect. I doubt you could do that with the vanilla AI either! (at least I can't do it on my system, I barely get 25 FPS if all those AI are "active", i.e. all in combat mode and engaging each other) It's still too early to say anything about the maximum number of AI, but my goal is to keep it around 30 AI (~4 groups) on my laptop (a below average one) for ~60 FPS gameplay.
  2. Update: https://github.com/leopard20/All-In-One-Command-Menu/releases/tag/v1.2.5-Beta https://steamcommunity.com/sharedfiles/filedetails/?id=1893300731 # Added: * Tasking: Squad Leaders can now perform tasks (healing, etc.). In the case of healing, leaders have a lower priority to be medic. !! Warning !! Squad leaders cannot continue their vanilla waypoints until all their tasks are complete! You can cancel their tasks from the waypoint UI, as usual. * Inventory: Units can now access their vehicles' inventory without disembarking, like the player. Also, a shortcut is added to the "Inventory" sub-menu, called "On self" to open their vehicle's inventory. # Fixed: * Unstick: Unsticking would change the leader of the group since last update. * Heal: Units couldn't be healed properly if the unit was damaged both by ACE and vanilla damage systems. * Heal: Medic icon didn't disapper sometimes. * Waypoint UI: Refreshing the group would change the leader. # Improved: * Minor code optimization.
  3. I've been studying the problems with AI driving. Their handling seems to work fine except for when they go reverse, in which case they just disregard ALL objects! Including units! This one can't be fixed, so I'm currently using a dirty method where I just move the unit out of the way of the vehicle! The other problem is the way they constantly get stuck behind obstacles, and the culprit is the path generation. So what I'm trying to do is use my own path generation algorithm (with some modifications for vehicles) to fix the problem. Obviously it's trickier because vehicles are bigger and require more intersect checks (which also slows the path gen down compared to the one for infantry). I simply pass the generated path to this command (it's the only command that can be used to move a vehicle properly): https://community.bistudio.com/wiki/setDriveOnPath The early results look promising. I can get them to move around obstacles way better (especially on more cluttered maps, such as Diyalah and its infamous canals and fences!). Even when I put two obstacles in back and front of the vehicle (basically box it in), it can get out just fine (it's not pretty though, because it has to keep moving backward and forward and it constantly crashes with the obstacles). But it still needs lots of refinements to be usable. The only problem is I have to use doStop to use that command. Thankfully, it doesn't mess with the waypoints. One of the good things about my path generation algorithm is that it works faster in water compared to the vanilla one (you might've noticed this if you ever tried ordering a boat to go somewhere near the shore). Unfortunately, setDriveOnPath command doesn't seem to work for boats. So my path generation function can't help right now. 😕 I think it might be possible. I might do more things when the path generation function is complete. This one is related to infantry AI. And good news, they already do that! (not exactly like that video, but close!)
  4. I've been putting more time into it lately due to having nothing else to do (because of the coronavirus outbreak, of course). So there has been some good progress. For the record, I have set 3 milestones for the mod: 1. Proof of concept: making sure it's possible to make a new AI by implementing some of the basic functions. This was what I showed you in the first video. 2. Completing (sometimes rewriting) and optimizing all functions required for individual AI, to make sure each one can do what they have to do. This includes movement, formation, targeting, shooting, path generation, cover system, suppression system, etc. In other words, all fundamental functions for an AI. This is what I'm doing right now. I can't move on until I make sure all of them work properly. This is an interconnected system, so even a simple error in one part can lead to several problems in the others. Recently, I've decided to do something about the vehicle AI. Don't get your hopes up though, as I can't manipulate vehicles like the infantry units. There's simply not enough commands available. But I believe something can be done. I will post a video to show you the results when this step is complete. 3. Completing all functions required for AI groups; this makes them work as a team (right now there's no cohesion between them). This is similar to what most other AI mods do. I have more plans, of course.
  5. Update: https://github.com/leopard20/All-In-One-Command-Menu/releases/latest https://steamcommunity.com/sharedfiles/filedetails/?id=1893300731 # Fixed: * Mount: Units would sometimes stick out of vehicles with door animations (CUP/RHS/IFA3,GM,etc. vehicles mostly) * Support: Before adding Artillery groups to player, a delay is added to make sure the vehicle is mounted. Otherwise the group wouldn't appear in the supports menu. * General: Added time limit to some infinite loops to make sure they can terminate. This avoids unnecessary load on the scheduler. * Tasking: Added a more rigorous method for changing the units' "currentCommand" into "STOP" (required for tasking)
  6. You shouldn't directly copy the "< condition used >" part! It's not a valid expression. That's why you get an error. What pierremgi meant is that you should put the appropriate condition there.
  7. Hello everyone. Let's say I want to place array A inside array B: B = [....A....] The dots mean there may be other variables with fixed memory size after or before A (typically some strings or integers in my code). Array A however, may have a variable size (due to using pushBack/append/deleteAt/set for this array), from 0 all the way up to hundreds of elements. In terms of memory allocation speed, is there any difference where you put A inside B? Also, does reading speed (B select _index) vary according to where A is? (I think it doesn't, but asking to make sure) I'm asking this because arrays B and A (and their contents) are read and sometimes modified per frame.
  8. Small update: https://steamcommunity.com/sharedfiles/filedetails/?id=1893300731 https://github.com/leopard20/All-In-One-Command-Menu/releases/latest # Fixed: * Mount and Action commands were not recognized as 'whitelisted' vanilla commands, thus couldn't override the tasks.
  9. It's a general question. No code is needed. I don't think anyone but the devs can answer it. Hopefully @Dedmen or @Dwarden can help!
  10. @quickdagger He's right. If you're using ACE, use handleDamage instead. Be sure to include the damage at the end of the code otherwise the unit won't take any damage.
  11. Dynamic mesh generation for buildings, which is used for path generation inside buildings for my AI. It has to be done ASAP otherwise the AI will just stay in place waiting for the mesh to complete.
  12. Hey guys. Does anyone know a way to "call" a function/script from the scheduled environment? In other words, let's say I've already spawned a script: 0 spawn { call MY_fnc_TEST } Any function called inside this script will obviously get executed in the scheduled environment (canSuspend). But I want it to get called in the unscheduled environment. One way I know is to do something like this: 0 spawn { OnEachFrame {call MY_fnc_TEST; onEachFrame ""}; } which is quite awkward. Plus the function will not get executed before the rest of the script (it gets called in the next frame). This can be verified using: AAA = 1; 0 spawn { onEachFrame {AAA = AAA + 1; onEachFrame ""}; AAA = AAA/2 }; This gives AAA = 1.5 instead of 1. Does anyone know a better way?!
  13. If you don't know the correct type for nearestObjects, just leave it empty or use "All"
  14. Object IDs change per map (and so does the object). You can't do it for the object itself. You can, however, export the type of the object, which is a string corresponding to its class name: typeOf _obj For example: Let's say typeOf _obj for your tower returns: "Land_Tower". You should create an array with a list of object types you don't want to damage. Then, you remove objects that match these types: _noDamageObjTypes = ["Land_Tower"]; //this is an example; you should use the correct object type (typeOf _obj) here _noDamageObjs = (nearestObjects [player, ["Building"], 100]) select {!(typeOf _x in _noDamageObjTypes)}; If you want to do it for terrain objects, replace nearestObjects with nearestTerrainObjects. Learn about array operations here: https://community.bistudio.com/wiki/Array No, it returns objects. What you see are object IDs converted to strings.
  15. I'm saying don't use strings instead of objects. Read about variable types here: https://community.bistudio.com/wiki/Data_Types#Available_Types What are you even trying to do?
  16. Man! This is exactly what I was looking for! I just gave it a test and it works wonders. You see, I have a time critical script that has a for loop with another nested for loop: for "_i" from _a to _b do { for "_j" from _c to _d do { } } I have optimized it as far as I could but it's still slower than what I wanted. I was trying to somehow improve its execution time at the cost of some performance loss. So I did this: for "_i" from _a to _b do { isNil { for "_j" from _c to _d do { }; } } And execution time has been improved by ~%35 with minimal frame loss! BTW, the waitUntil part doesn't seem to be be needed according to my tests.
  17. I want to run a script during the mission. Post init and other stuff are irrelevant here.
  18. Unscheduled codes get executed exactly in one frame (even if it means halting the game). It is essential for certain time critical scripts to get called immediately without waiting for the scheduler to queue them. The scheduler delays scripts that take more than 3 ms to run, which means if many other scripts are still running your code will take forever (in relative terms) to get executed
  19. Is it necessary to use waitUntil?
  20. I know but I want to switch from the unscheduled env directly to the scheduled environment without terminating the script.
  21. Leopard20

    Odd attachTo problem

    I explained above:
  22. Technically, yeah, it works. Thanks. I guess a simple sleep 0.001 does the same thing (it waits one frame). I was hoping for a more straightforward solution for calling (besides onEachFrame).
  23. Leopard20

    Odd attachTo problem

    This is what I mean:
×