|
beauty queen breakdown posted:Seconding the notes above on Godot 3.0, but adding a question -- Do you mean it doesn't do version control with git? While Godot doesn't handle version control for you, there's nothing stopping you from putting your Godot-based game in version control yourself, including git.
|
# ? Apr 17, 2018 07:08 |
|
|
# ? May 25, 2024 13:15 |
|
nolen posted:I'm trying to build a Quarth clone for funsies and am kinda stuck on the logic that determines when a set of combined shapes equals a rectangle. What if you had something like a 5x5 inverted-U shape with a 3x3 inverted-U shape inside it, and then filled those last two squares, does it kill the big square or the small square? Also seems like it would be possible to complete two rectangles at the same time, one wide and one tall, what should happen in that case? Destroy both? Destroy the larger one? Is it not possible for some reason? Anyway, given that you only need to check when a new cell is added, this seems like a job for a simple brute-force-ish algorithm, where you don't consider the shapes at all, you just consider individual cells and boundaries. 1. starting from your new cell (x, y) you extend out to the largest distance you can in each cardinal direction until you hit an empty cell (keep left, right, top, bottom). 2. four way nested loop (testLeft in range left...x) (testRight in range right...x) (testTop in range top...y) (testBot in range bottom...y) 3. if testLeft == testRight || testTop == testBot skip it. 4. check that every cell in the described test rectangle is occupied - skip out as soon as you find one that's not. 5. check the boundaries of the cells of the described rectangle - if eg. any cell of testLeft is connected to testLeft-1 skip out. 6. save the rectangle you've found here, it's ready to disappear. 7. end the loop 8. disappear all the cells in any of the rectangles you saved. This seems horrifying because it's an O(n^6) algorithm, but all the 'n' are very very small and you don't do it very frequently, so it's almost certainly not worth trying to optimize beyond this. This method presupposes that the data structure is comprised of a grid of cells and whether they are connected horizontally/vertically, and not a data structure of shapes. If instead the data structure is shapes, you could do an O(n!) in the number of shapes solution, wherein you first take every combination of shapes that includes the newly updated shape, and then calculate: 1. (left, right, top, bottom) = the leftmost coordinate, rightmost coordinate, etc. of all the shapes selected for comparison. 2. sum of the total number of cells in all the selected shapes. 3. if (right-left) * (bottom-top) == sum, you have a rectangle ready to disappear.
|
# ? Apr 17, 2018 07:13 |
|
roomforthetuna posted:I'm guessing single column/row doesn't count as a rectangle? code:
You can improve the algorithm by realizing utilizing the fact that only one rectangle can be cleared at a time (along with any number of extensions). E.g you only need to look for extensions to a rectangle after you’ve completed the base rectangle.
|
# ? Apr 17, 2018 09:58 |
|
Portland Sucks posted:I don't know much about game/graphics development, but I've got a use case at work that I think might call for Unity and just want to verify that it may be a good option before wasting too much time chasing down a hole for nothing. Unity could work for you, but it will use more of your CPU than other solutions. 2 other things to consider are HTML + Javascript, or GoDot. If you do end up using Unity make sure to turn on VSync so that the system doesn't waste a ton of rendering 1000fps.
|
# ? Apr 17, 2018 14:53 |
|
leper khan posted:Not op but a fan of quarth. You would need to fill 5 squares for the two U’s described; all of it would be cleared at once. If you filled the middle before extending a side, the interior U would clear before the exterior. Now that you've given me a way to describe a thing, what about this then, vs. the "only one rectangle at a time" rule? code:
|
# ? Apr 17, 2018 14:59 |
|
Stick100 posted:Unity could work for you, but it will use more of your CPU than other solutions. 2 other things to consider are HTML + Javascript, or GoDot. If you do end up using Unity make sure to turn on VSync so that the system doesn't waste a ton of rendering 1000fps.
|
# ? Apr 17, 2018 15:08 |
|
My idea for Quarth: Edit: Nevermind, after watching a gameplay video I see the rules are different than I thought they were. I didn't realize it was possible to have "holes" in the rectangles. I'll leave this here anyway. My terminology is there are pieces (just 1x1) and groups (the groups are the collections of pieces with the boundaries) For groups, keep track of their bounding boxes (max_x, max_y, min_x, min_y) and how many pieces are in them. Update these values accordingly when a piece is added to a group. To find if a set of groups makes a rectangle, find the total bounding box for the whole set (pretty straightforward, for example the max_x value of the set is the maximum of the groups' max_x values) and the total number of pieces in the set (just the sum of the pieces in each group). It's a rectangle if the area of the bounding box matches the total number of pieces (I'm guessing 1xN rectangles don't count either, so check for that). This is a very cheap calculation. You can probably just brute force through all sets of groups touching the newly added piece and take the largest set. It's n! but n is pretty small. You can speed up the search by always including the group of the newly added piece (since this must be part of the resulting rectangle, if it exists) so it's (n-1)! There's probably a better approach than the brute force method but I like the method of comparing the area of the bounding box to the total number of pieces in determining rectangles. HappyHippo fucked around with this message at 15:32 on Apr 17, 2018 |
# ? Apr 17, 2018 15:28 |
|
roomforthetuna posted:Both Unity and Godot will use a bunch of CPU constantly rendering, neither has a "this is static now, don't do anything until the user does something" mode. Vsync will make it 60fps instead of 1000fps, but for a UI you probably really want 0fps waiting for input. This is an especially annoying trait for phone support where one might particularly like to conserve battery by rendering nothing while a game is paused, for example. The best you can do for that is reduce the frame rate, but that also reduces how quickly it will respond. This sucks so much about Unity, now that I'm doing a mobile app that's a mostly UI game(laser tag interface for hardware blaster). I thought I had figured out a way to do 60fps input and saving some battery by disabling the camera every other frame but I had a bug and it wasn't actually doing anything. Still wondering if maybe rendering to a render texture and just re-rendering it every X frames will save something, but I suspect not much if anything for the extra work to get it going.
|
# ? Apr 17, 2018 15:29 |
|
roomforthetuna posted:Oops, yeah, I meant 5x5 with 4x3 inside it. But I guess the answer is "the bigger one" in this case. Judging from gameplay videos there are no shapes like C, the pieces always come with a "hook" at minimum, although maybe I haven't watched enough
|
# ? Apr 17, 2018 15:34 |
|
Obsurveyor posted:This sucks so much about Unity, now that I'm doing a mobile app that's a mostly UI game(laser tag interface for hardware blaster). I thought I had figured out a way to do 60fps input and saving some battery by disabling the camera every other frame but I had a bug and it wasn't actually doing anything. Still wondering if maybe rendering to a render texture and just re-rendering it every X frames will save something, but I suspect not much if anything for the extra work to get it going. Would that happen to be for Recoil or a competitor?
|
# ? Apr 17, 2018 17:49 |
|
Doc Block posted:Do you mean it doesn't do version control with git? While Godot doesn't handle version control for you, there's nothing stopping you from putting your Godot-based game in version control yourself, including git. What I meant was that Godot does allow me to do version-control with git from the command line (as I prefer) -- I used the phrase "doesn't die to," which in retrospect was a bit confusing. The main issue I have with it is adding things inside the interface involves a lot of point, click, &c. I'm doing my best to stick with it but coming from an enterprise dev perspective I'd way rather just write the code elsewhere and verify the results in the interface (if I have to use the interface at all).
|
# ? Apr 17, 2018 18:36 |
|
You can do pretty much everything in code in Godot, it’s just that most people don’t want to.
|
# ? Apr 17, 2018 19:06 |
|
Would Godot be good for somebody with severe NIH syndrome (me)??
|
# ? Apr 17, 2018 19:35 |
|
Might I suggest writing your game completely in assembly?
|
# ? Apr 17, 2018 19:46 |
|
If it worked for Roller Coaster Tycoon it can work for you!
|
# ? Apr 17, 2018 19:58 |
|
HiriseSoftware posted:Would that happen to be for Recoil or a competitor? The former
|
# ? Apr 17, 2018 20:36 |
|
Obsurveyor posted:The former Finally, a use for those AR marker cards!
|
# ? Apr 17, 2018 21:26 |
|
baby puzzle posted:Would Godot be good for somebody with severe NIH syndrome (me)?? SDL might be acceptable, because you have more control, but as far as I could tell SDL is a giant pain in the rear end to *really* build cross-platform. It's fairly painful to even get it to build properly on one platform. And even then it already abstracts input away too much and requires it to be on the same thread as rendering which is really loving annoying when you're that close to being bare-metal. The nice thing about Godot is that it's not very pushy at all - if you don't want to use some feature, you don't have to jump through hoops to avoid it, you can just not use it. Also, most of the features are actually good and work well, so the impetus to not use them is much smaller than with other engines.
|
# ? Apr 18, 2018 00:29 |
|
Only issue I have is at present Godot doesn't have the full shader pipeline, only vert and frag right now. The issue about adding Tess or Geom stages is kind of stalled because nobody seems to want to do it right now.
|
# ? Apr 18, 2018 01:36 |
|
roomforthetuna posted:SDL might be acceptable, because you have more control, but as far as I could tell SDL is a giant pain in the rear end to *really* build cross-platform. It's fairly painful to even get it to build properly on one platform. And even then it already abstracts input away too much and requires it to be on the same thread as rendering which is really loving annoying when you're that close to being bare-metal. Does this matter if you aren’t using SDL rendering and only need it for input and window creation and some other misc. stuff? Just init the ‘video system’ from your input thread and you are good.
|
# ? Apr 18, 2018 05:30 |
|
Linear Zoetrope posted:Only issue I have is at present Godot doesn't have the full shader pipeline, only vert and frag right now. The issue about adding Tess or Geom stages is kind of stalled because nobody seems to want to do it right now. tess and geom are useless so that's fine.
|
# ? Apr 18, 2018 16:49 |
|
I want to make a Sim/Tycoon type game, but I'm basically stuck on the application architecture/design/pattern/whatever. You know, like having customers walk around like in Roller Coaster Tycoon and they feel like buying stuff or riding attractions. I'm not trying to be overly ambitious, I swear. I'd be happy with making something along the lines of one of the Kairosoft games or Tiny Tower were you can make like a mall or a school and people are wandering around doing stuff. Does anyone have any recommendations for any books or articles that would help me wrap my head around building such a game? I am web developer by trade so figuring out how to structure a game that isn't like a basic 2d platformer escapes me.
|
# ? Apr 18, 2018 19:52 |
|
The most important part of that kind of game is how you define the rules that govern your Sims. In RCT they basically wander pretty aimlessly and decide what to do when they bounce up against something (so if they walk up to a food stall they decide then and there if they're hungry and if they are they buy something and if they aren't they don't, based on the price). Sometimes they decide they actually want something enough to pathfind to it (when they want to ride a ride again, or if they're really hungry, or if they want to leave the park, etc.). Performance can be important because you're potentially simulating and rendering hundreds if not thousands of Sims so it's important to keep them as simple as possible. Their collectively behaviour is more important than having their individual behavior be super realistic, if that makes sense. The architecture doesn't have to be more elaborate than an update-render game loop. You'll want to look up efficient pathfinding, and maybe finite state machines for the Sims (although that certainly isn't the only approach to take). HappyHippo fucked around with this message at 20:24 on Apr 18, 2018 |
# ? Apr 18, 2018 20:20 |
|
People designing open world games. How do you deal with "important enemies" (i.e. Enemies that are stalking the player character) but are too far from the player? In most games enemies get despawned and then maybe respawned, do you still update the ai for some enemies even if you despawned the world around them?
|
# ? Apr 18, 2018 21:20 |
|
HappyHippo posted:The most important part of that kind of game is how you define the rules that govern your Sims. In RCT they basically wander pretty aimlessly and decide what to do when they bounce up against something (so if they walk up to a food stall they decide then and there if they're hungry and if they are they buy something and if they aren't they don't, based on the price). Sometimes they decide they actually want something enough to pathfind to it (when they want to ride a ride again, or if they're really hungry, or if they want to leave the park, etc.). Ah, so just have a collection of sims objects and loop over them each update and process their behaviors/stats/movement? Your explanation is getting the gears turning in my brain so thanks for that
|
# ? Apr 18, 2018 21:33 |
|
Suspicious Dish posted:tess and geom are useless so that's fine. I want to play with experimental geometry (e.g. geometry that changes shape based on perspective) so Tess is helpful for that. Otherwise you get a nest of dummy objects and obfuscation tricks to hide you subbing out models.
|
# ? Apr 18, 2018 22:18 |
|
Casaval posted:Ah, so just have a collection of sims objects and loop over them each update and process their behaviors/stats/movement? Yeah that's the idea. One of the biggest performance costs are when sims have to interact, because you don't want each sim to loop over each other sim to detect collisions, etc. You'll notice RCT gets away with this simply by letting the sims walk right through each other - they don't interact at all. The other big performance cost can be pathfinding. Pathfinding for hundreds of sims in real time can be expensive. In RCT the sims often wander aimlessly, avoiding pathfinding althogether. When they do pathfind they likely perform a single pathfind and save the path - this is made easier by the fact that they're allowed to walk through each other, so the path doesn't have to avoid moving obstacles. Good luck! HappyHippo fucked around with this message at 22:23 on Apr 18, 2018 |
# ? Apr 18, 2018 22:19 |
|
I now want a duo of crafty characters named Tess and Geom.
|
# ? Apr 18, 2018 22:25 |
|
Linear Zoetrope posted:I want to play with experimental geometry (e.g. geometry that changes shape based on perspective) so Tess is helpful for that. Otherwise you get a nest of dummy objects and obfuscation tricks to hide you subbing out models. use compute or cpu
|
# ? Apr 18, 2018 22:50 |
|
Note that sims in rct don't try really hard to find a viable path to the exit, and if they fail the game will warn you with a "beep". I remember being driven to tears of anger as a child cause I would get that beep like 10 times a second in my park.
|
# ? Apr 18, 2018 22:53 |
|
Yeah those park goers were dumb as hell
|
# ? Apr 18, 2018 23:12 |
|
I have what seems to be a terribly optimized method, in Unity, that is drawing to the screen every frame. I'm using physics objects to get some raw data, projecting their position to the screen, and using that to populate voxel data that I then run marching squares on and draw the marched data to the screen. It's running badly, I drop from like 250fps or 120fps to 30 when I turn the marching cubes rendering on. I feel like I should do this drawing as a shader but I'm not really sure, I've also never written a shader before as much as I want to/need to. Here's my code, there's 3 nested for loops that I'm pretty sure aren't helping, but I'm not sure how to optimize it. I'd like to hear what suggestions for optimizations you here could offer. Any would be appreciated! I implemented a quad tree to help cut down on areas that I don't have to render, and that helped a bunch but not enough. I ideally want to have like 50 physics objects on screen at once and keep my fps above 60, or at least 30. https://github.com/KoRMaK/IsometricLiquid/blob/c75a4a95b8e5b758772763857e9b4fc530ea9c41/Assets/src/ScreenDrawer.cs#L82 Comment out lines 81-85 and you get a huge fps jump. Comment out line 81 and 82 or 83 separately and you get a big fps jump. If you clone this repo, you should be able to open it in Unity and start running it, so feel free to play around in it if you want to see the heck I've created for myself. KoRMaK fucked around with this message at 03:36 on Apr 19, 2018 |
# ? Apr 19, 2018 03:34 |
|
limaCAT posted:People designing open world games. How do you deal with "important enemies" (i.e. Enemies that are stalking the player character) but are too far from the player? In most games enemies get despawned and then maybe respawned, do you still update the ai for some enemies even if you despawned the world around them? I can't imagine these enemies can do anything with the world around them if you unloaded the world representation. Are they literally stalking the player? Presumably they are doing a bad job! Or if you are trying to represent them, say, catching wind of you from the other side of the world, then it just has to be scripted with an approximation.
|
# ? Apr 19, 2018 05:50 |
|
Funnily enough, S.T.A.L.K.E.R is an excellent example of how to do that. Within a certain radius of the player, AI is fully represented in the game world. Elsewhere it's just graphs and such. The term is "A-Life" and it got modded heavily, especially in the original game. Here's a good summation Cheston fucked around with this message at 18:21 on Apr 19, 2018 |
# ? Apr 19, 2018 18:17 |
|
I was trying to delegate more work into InkScript to call back into game logic, and I discovered this was very much poopoo'd by the developers; the functions would get called during parsing and cause havoc. I am wondering now with Unity supporting .net 4.6 if I should just go back to playing with IronPython. Has anybody bit that bullet yet?
|
# ? Apr 20, 2018 17:13 |
|
Godot engine's page not found thing looks like goatse to me:code:
|
# ? Apr 21, 2018 00:03 |
|
Good job outing yourself as being born after 1990.
|
# ? Apr 21, 2018 00:12 |
|
Rocko Bonaparte posted:I was trying to delegate more work into InkScript to call back into game logic, and I discovered this was very much poopoo'd by the developers; the functions would get called during parsing and cause havoc. I am wondering now with Unity supporting .net 4.6 if I should just go back to playing with IronPython. Has anybody bit that bullet yet? I'm starting to think the fact that people don't really have anything to say about me and this scripting stuff is telling me I'm very, very alone here. But if somebody wants to join the "trying to use IronPython in Unity with .NET 4.6" clubhouse: code:
|
# ? Apr 21, 2018 06:29 |
|
Rocko Bonaparte posted:I'm starting to think the fact that people don't really have anything to say about me and this scripting stuff is telling me I'm very, very alone here. I think most people would be a bit confused as to why you would want to do such a thing, but I assume it's to be able to do some runtime scripting stuff? I often find it useful to be able to add arithmetic expressions that can be stored as a string per object and compiled and evaluated on the fly, and I briefly considered adding a general scripting engine like Javascript or something for that. But 1) it turns out they always use JIT for everything with no fallbacks, which will not work on a lot of platforms (iOS, consoles, etc) and 2) they are huge. So I always opt for a simple domain specific language that only does what I need. Hell, I've written so many parsers in my days it's pretty much trivial by now (protip: look up "Pratt parser" if you haven't heard of it; it's really neat). Recently I wrote a little language for our text files, which sometimes need to be tweaked in cumbersome ways to accommodate the quirks of various real-life languages. But since the majority of lines won't need special numeral reordering or whatever, it would be waste to put all text in like Lisp or something, so I wrote a thing that's optimized for storing and retrieving regular key-value pairs, but can also handle this code:
You can also do string operations of course (that's mainly what it's for), and build up a new string, and then you can @ that too, so stuff like [ @("Hello" + "World")<p: "what up"> ], would get the string with the key HelloWorld, and send it the parameter p. (Obviously you wouldn't want to use it for complicated stuff like sorting lists though, but I thought the list expansion and matching operators were neat) Mooey Cow fucked around with this message at 15:18 on Apr 21, 2018 |
# ? Apr 21, 2018 15:15 |
|
|
# ? May 25, 2024 13:15 |
|
Mooey Cow posted:I think most people would be a bit confused as to why you would want to do such a thing, but I assume it's to be able to do some runtime scripting stuff? I'm trying to do a "small action RPG" (lol I know I'm dumb) and I had to deal with NPC interactions and triggers. It was rapidly getting tedious to vomit that logic out in C#. I went with Ink Script first because I was preoccupied with basic dialogs and choices. Then I started to implement a shopkeeper with a buy/sell option and a generating a second menu. This got real clumsy to do in Ink Script. Because calling back with functions that affect state is poo-poo'd, I have to instead observe some boolean variables like a giant switch board, extract state and then map to the function I wanted to call. It's that or embed the call as some tagged metadata in the dialogs or something. Either way was getting gross. quote:I often find it useful to be able to add arithmetic expressions that can be stored as a string per object and compiled and evaluated on the fly, and I briefly considered adding a general scripting engine like Javascript or something for that. But 1) it turns out they always use JIT for everything with no fallbacks, which will not work on a lot of platforms (iOS, consoles, etc) I just looked at DLR JavaScript implementations and... yeap that sucks. quote:So I always opt for a simple domain specific language that only does what I need. Hell, I've written so many parsers in my days it's pretty much trivial by now (protip: look up "Pratt parser" if you haven't heard of it; it's really neat). But I'm not making GBS threads on you; if you do that a lot then I imagine your kung fu has gotten a bit more strong and true. Edit: A big thing I think I need is to be re-entrant. That's a tricky one with embedding Python here. Ink was nice to be able to pick up the conversation where I left off, and I could shoehorn some logic to reset if that's what I actually wanted. Rocko Bonaparte fucked around with this message at 17:49 on Apr 21, 2018 |
# ? Apr 21, 2018 17:33 |