Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

979 Good


About menyo

  • Rank
    Advanced Member


  • Twitter
  • Github
  • Steam

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. That happened before 😅. But how would you pass data around then? I am currently playing around with the behavior tree library of GdxAI. In the example they are using the object itself as a blackboard, it gets passed to every task in the behavior tree so it can manipulate it or use it's methods. It is also working with a Map<String, Object> where I would test the data needed for a task in the start() method and immediately return failure when data is incomplete, like when there is a AttackTask without a prior task that sets an enemy for it in the Map. Then there is the blackboard I spoke about earlier, a class specially catered to that and grows in size when the amount of task and needs grow. I could pass this as well along the tree but it does not seem a good choice compared to the other two.
  2. Well I did a bit more research and tried implementing my own to at least understand BT's better. Using the actual object that the behavior tree controls looks like a much better alternative then some examples show. This however makes it mandatory to have to have references of everything the behavior tree might need inside it. But I have always found that a creature should be aware of the map and it's surroundings itself instead of having some kind of handler class for it. Another way I have been trying is to just pass a Map<String, Object> along the tree, an attack task would be run after a SearchEnemyTask task in sequence. The SearchEnemyTask tries to find an appropriate enemy and sets something along the lines of blackboard.put("target", targetEntity). Now this is a little less "safe" but does seem to be more versatile, if I ever want to create an automatic door using a BT I can just reuse openDoorTask on it instead of the above method where I would need to create a new Task with a Door as a blackboard. It's still hard to wrap my head around the complete concept but I'm getting there, but I was hoping for some more input here.
  3. I really like to add AI to my game in the form of behavior trees and have been reading about them. The primary thing I am "stuck" with is how to pass data. Some articles mention a blackboard that should be passed down the tree nodes so they can set fields on it, but this means for each leave task that needs some form of data the blackboard gets a field. I imagine a lot of leave leave tasks and some need many fields to set on this blackboard and this deviates from my perception of clean and scalable code. Are there other ways to handle this?
  4. Well, I don't think my engine "really, really needs state of the art transparency", after all it's "just" a isometric game and the camera is fixed so I know what to draw first. Still the problem remains, if I draw large chunks of the map in one mesh I need some sore of technique to put another mesh properly "inside" that large chunk. Splitting out transparent objects from this chunk mesh and then render them in the correct order myself sound like a good option then. I don't even have to sort them really since I can just loop from back to front, it's a tilemap after all. I thought of another technique however. Zooming all the way out reveals about 4000 tiles on screen and currently more are drawn since I use a diamond isometric pattern. The bottom layer all have a floor to be drawn but I calculate less then 10% of these tiles have a object and/or walls. So if I can reduce those 4000+ floor draw calls by putting just the floor in a batched mesh I'm already saving a lot of draw calls. It would not be optimal but probably good enough and very easy to implement. I wasn't aware of buffer streaming and I really should read up on OpenGL concepts a lot more, but I like to work on my game too and in the mean time read all those books about machine learning I bought on the humble bundle oh and then there is my kid and I remember having a wife too... 😂 there is just so little time 😰. Anyway, I think the reason you are pointing me to buffer streaming is because I need to alter these chunk meshes a lot, take out transparent parts and insert opaque parts, am I correct? I'm not even sure what the relation between a LibGDX Mesh and a Buffer Object is, the mesh holds Vertex data and I read a Buffer Object can hold Vertex Data too but I have no clue what exactly is being send over to GPU.
  5. I am currently trying to draw a isometric map in batches, these batches are meshes put together from map data. For each wall and floor I am creating a quad and add that to the chunks mesh. Because I am using alpha blending for a lot of objects I generate these meshes in the order they should be drawn and draw the combined chunk meshes back to front and bottom to top for multiple height levels. This works all great and I can draw a huge part of my map while remaining my target FPS of 60.The meshes and objects go allong the normal axis and I just rotate a Orthographic camera to get it's isometric projection matrix. Now comes the tricky part, the dynamic objects have transparency as well, they are also just quads with a transparent texture. If I draw a mesh later in sequence but behind a transparent object in the world that mesh won't be visible trough the transparency of the object in front of it. I guess this is because the object behind does not exist at the moment of drawing the front object and so it is not being rendered on it's transparent pixels. If there is an obvious not too expensive solution for this issue I am saved. I need to draw moving transparent meshes in between these walls and objects belonging to the chunk mesh and I do not know OpenGL good enough to know if there is a trick for this. I can think of two unwanted options: Adding these dynamic objects to the chunks in the right draw does not seem like a proper solution since that means rearranging the whole mesh each time something moves. Dump the whole chunk idea and just draw each object individually and deal with the loss in frames in other area's. Making dynamic objects full 3D instead of just a quad with a texture. Now I can just draw it before the chunk and depth sorting should sort it. However, I cannot use any transparency on these objects which is a sever limitation and I wanted to avoid going "full 3D". Besides that, I might want to add 2D particle effects at a much later stage so I am really a much happier man if I can sort the drawing out. Don't combine the transparent objects in the chunks mesh and draw all these later, together with the dynamic meshes and properly sorted. The latter seems like the best option now but it feels hacky and error prone. This is a whole other question but if this is a viable solution are there good and proven ways to add and remove meshes/vertex data/indices from a mesh and keeping vertex data and indices properly sorted, I also need to add meshes in the proper draw order as I explained earlier. I guess I need to keep this data somewhere when I create my chunk meshes and look it up later. Anyway, a proper solution (magic trick) to get the draw order and transparency correct in the first place would be awesome. I am using LibGDX btw and here is some code I use for drawing. Gdx.gl.glEnable(GL20.GL_DEPTH_TEST); Gdx.gl.glEnable(GL20.GL_BLEND); // I tried a lot of different combinations of blend functions, but as always this comes closest. Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA); // Very basic shader just taking in position and UV coordinates. // If the shader can do anything for me in regard of my problem I'd really like to know. shader.begin(); shader.setUniformMatrix("u_worldView", cam.combined); // If I draw the player before the chunk the transparent pixels of the player would not render the chunk. player.getMesh().render(shader, GL20.GL_TRIANGLES); // Drawing the mesh chunk combines of floors, walls and objects of each tile within the chunk. chunk.getCombinedMesh().render(shader, GL20.GL_TRIANGLES); // If I draw the player after the chunk the player would not be drawn if it is behind a transparent mesh like a window or a tree. player.getMesh().render(shader, GL20.GL_TRIANGLES); shader.end(); So is this drawing order problem really that complicated or expensive to easily solve by OpenGL or have I been looking in the wrong places for a solution?
  6. menyo

    Want to gain sevap points??

    Well you came to the right place, we are all here to help out. But there is no babysitting and holding hands. Basic knowledge of C# is all you need to create a game but you got to keep it simple enough. So take a real simple game and start to clone it, perhaps first something like Pong or look for something on the Play or App Store. I recommend staying away from Engines because they don't really teach you how to program properly, simply said they just teach you how to inject code in the engine. A framework like Monogame for C# or LibGDX for Java will teach you a lot more about programming and are a better choice if you actually want to learn a programming language, imho. Really don't be bored and start creating simple games and learn as you go. If you are stuck don't be ashamed to drop your code here and together we make it work. The only tips I can currently give you is to keep your methods short and readable for both yourself and when you are looking for help.
  7. menyo

    Auth tokens

    A random string, that is actually how I did it before and used a org.bson.types.ObjectId. Having the username and token let's anyone login counts for both options but I do think that using a security library will add an additional layer. Apart from that, a token can hold additional data such as privileges, I'm not sure if I will use it but by implementing JWT with just a couple lines I got that functionality at hand. Is there any particular reason why you value generating a random key over hashing on the server side? Sure the user can register by a traditional email/password or link it with social media platforms and is notified every now and then if he wants to register or link his account. If the user does neither and the token is lost, most likely by removing the app the account is lost.
  8. menyo

    Auth tokens

    I want a token authentication system, you know, so users don't have to bother filling out username and password and can immediately start to have fun. I used to just store a random string both locally and in the database and use that together with the username to create a automated login system but I guess that is relatively easy to abuse. Now I have started with JWT but I have no clue what I am doing. I am running a basic client/server architecture on java using KryoNet. The following code creates and returns a token as a String: public String generateToken(String subject) { Key key = Keys.secretKeyFor(SignatureAlgorithm.HS256); return Jwts.builder().setSubject(subject).signWith(key).compact(); } First thing I am wondering is if this is "secure enough"? I really don't need more security then any other proper game out there. I guess a username (as the subject) is easy to guess but does the key provide enough security or do I need to add additional claims? Now I guess I have to store that key in the database alongside the user credentials and send the token to the client to be stored locally for reuse. Then I can do the following when I need to authenticate the user. Send the token and username from the client. Get the key from the database using the username to lookup. Parse the token using the key and username like so: Jwts.parser().setSigningKey(key).parseClaimsJws(token).getBody().getSubject().equals(subject); Other then login the user how often should I check the authentication token? Would just the login be enough or perhaps just each "sensitive" request from the client? Like I said I am using Kryonet once a connection is established I use that connection to handle the actions for that particular client, this makes me think that just the initial login is enough. Someone connecting from somewhere else would get a different connection and needs to have a proper token or login credential to do anything user related.
  9. I want to create a good all round font system I can use throughout my apps. So I did some research on how Google does there layout, especially font sizes for different elements. Turns out they introduced SP, a font size similar to DP but takes in a scaling unit so user can enlarge all the text if the want while still maintaining the general look. I figured I start by creating a couple font elements from the google design guide below, they use there own Roboto font for this and the image below for reference. Since it's an image, obviously the text is already in pixels so the actual sizes cannot be used for reference. I am using LibgDX and since LibGDX works with bitmap fonts I use the Freetypefont library to generate them at runtime.DP or density independant pixels are relative to a 160 dpi screen. So to get the amount of pixels we need to divide the screens actual PPI/DPI by 160 (for mdpi screens) to get pixel density relative to mdpi and then multiply that pixel density by the DP amount listed in the above image as SP. In LibGDX there is a function to get the density factor right away: Gdx.graphics.getDensity() so to get the body font google is using I do: parameter.size = (int)(14 * Gdx.graphics.getDensity() * scale); BitmapFont body = regular.generateFont(parameter); // regular is the FreeTypeFontGenerator holding the Roboto Regular font. And rendering this to my S8 screen is working great. The S8 has a pixel density of 3 so the DP/SP value gets multiplied by 3. Now I tested this on my monitor and the font is barely readable. I checked the PPI/DPI of my monitor and that is roughly 96 so 96/160 = 0.6 pixel density. So the body font on desktop will be 14 * 0.6 = 8.4 pixels so it is unreadable but funny enough the same size as my S8. But why? Shouldn't I end up with the same size font in CSS for both desktop and my S8? body { font-family: 'Roboto', sans-serif; font-size: 14dp; // or sp } Yet the CSS is somewhat bigger and thus readable. I'm not sure comparing with HTML is the correct way but as far as I understand Google uses it for all it's layouts so also CSS. Anyway, when I just create my font with size 14 it will match the CSS. But obviously since the font is now 14 pixels on my S8 it will be really small since the pixels are so tightly packed. So what am I doing wrong? Are the numbers wrong? Have I some setting somewhere that makes my website text bigger then it should? Do I have an error in my understanding or calculations?
  10. menyo


    Mathemechanic is a number puzzle where you need to switch numbers in a grid on or off to match the target value for it's row and column. Switching one number directly influences the sum of it's column and row but also indirectly others much like in Sudoku. The game currently has 2 modes, normal mode where the clock counts up and you can improve your time on a specific board and Time Attack where you need to finish as much boards as possible within the given time to set a winning streak. Each mode has 20 different board combinations, the player can select between 5 different sizes and 4 different ranges of numbers. This currently ads up to 40 slightly different games where each holds a highscore and has a safe slot to continue at a later time. You can check out my other games on my website. If you want to stay updated on my projects follow me on twitter..
  11. Yeah I did it manually. It was very tedious however to get the icon how I wanted. Should be quicker next time. I filled a bug report for it too. I have no idea what's causing it, I have not too many tasks running in the background. Weird that I seem to be the only one experiencing this. Thanks for trying.
  12. This is shown in about: Android Studio 3.1.3 Build #AI-173.4819257, built on June 4, 2018 JRE: 1.8.0_152-release-1024-b02 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Windows 10 10.0
  13. Get rid of the "making money form my idea". If it's a great idea there surely are people and companies that can execute it better and use your idea. There is nothing wrong with that, otherwise we would just have 1 game of each genre right? Everybody has great ideas but in reality once developed most ideas are less good then they where in your brain. If you want to get into game development you need one of the skills to develop ideas into games. Like Rutin mentioned there are a lot of different positions in game development. If you want to develop a game yourself you need a broad skill set and you cannot expect yourself to be good at each aspect when others got good at a specific skill by practicing it for a decade or more. But one skill you 100% need if you want to develop your own game for a low budget is programming. Art can be bought and a lot of fairly simple but consistent art can be bought for a couple bucks like the asset packs from awesome Kenney. But nowhere you are going to find the code snippets to copy paste your game together. Do realise that marketing is another key aspect if you want to develop a successful game, even if you game has awesome graphics, music, sound and gameplay the chance it goes viral by itself is like a lottery ticket. Your best bet is to get really good in one skill, build a port folio and try to land a job at a small studio and go from there.
  14. I can but a video would do a better job in this case. What would be a nice work around? I found some generators online but they just ask an image and the Asset Studio creates the exact adaptive sizes and make sure it is within the "safe area". I could go with trial and error but I rather use a proper alternative to the Asset Studio if I cannot get it to work.
  15. I want to create a Launch Icon in Android Studio but it does not let me finish and generate once I set it up. I am pressing right mouse on the android module then select new -> Image Asset. This opens up a window to setup a icon. Whatever I do here, the finish button does not get enabled and whenever I click on the next button the Asset Studio just vibrates after a view seconds and nothing gets generated. I have tried both Launcher Icon (Legacy) and Launcher Icon (Adaptive and Legacy) modes but both act the same. Anyone know whats going on? After this issue I did a full update of Android Studio which didn't fix things either. Maybe I am forgetting something obvious? I am using Libgdx to build my project.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!