Jump to content
  • Advertisement

Rockroot

Member
  • Content Count

    10
  • Joined

  • Last visited

Community Reputation

2 Neutral

About Rockroot

  • Rank
    Member

Personal Information

  • Role
    Programmer
  • Interests
    Design
    Programming

Social

  • Twitter
    @TomRockroot
  • Github
    TomRockroot
  1. Hello, and thank you for your support! Yes, I linked it to show what I have available, so basically nothing. It also shows what I need to feed to the class to make a mesh appear. What I need is to fill the Mesh.vertices[] and the Mesh.triangles[]. To make my questions more precise: (They mainly revolve arround the structure/architecture of data storage) 1. In what fashion do I index the vertices? Is there some "best practice" amongst graphic programmers? 2. Is there a fitting, elegant algorithm already existing that matches the indices of the vertices[]-array to the triangles[]-array? 3. (Partly answered) How do I store the information for later usage in the pathfinder? This is what I got so far (creating a flat hexagon in C#): using UnityEngine; public class D_HexTile : MonoBehaviour { public float mSize = 1f; public Material mMaterial; void CreateHex() { gameObject.AddComponent<MeshFilter>(); gameObject.AddComponent<MeshRenderer>(); Mesh mesh = GetComponent<MeshFilter>().mesh; mesh.Clear(); // === Vertices === Vector3[] vertices = new Vector3[7]; vertices[0] = transform.position; for(int i = 1; i < vertices.Length; i++) { vertices[i] = GetCorner(transform.position, mSize, i - 1); } mesh.vertices = vertices; // === Triangles === int[] triangles = new int[6 * 3]; int triNum = 1; for(int l = 0; l < triangles.Length; l++) { if (l % 3 == 0) { triangles[l] = 0; } else if(l % 3 == 1) { triangles[l] = 1 + (triNum % 6); } else if(l % 3 == 2) { triangles[l] = triNum; triNum++; } } mesh.vertices = vertices; mesh.triangles = triangles; } private Vector3 GetCorner(Vector3 center, float size, int i) { float angleDeg = 60f * i; float angleRad = Mathf.Deg2Rad * angleDeg; return new Vector3(center.x + size * Mathf.Cos(angleRad), center.y, center.z + size * Mathf.Sin(angleRad)); } } I omitted parts for UV's and normals. I show this to give an example usage of the Mesh-class ... Now I have to feed it. So, this is obviously not enough. GetCorners() will suffice for the hexagon corners, but using the midpoints by doing vector-math for sub-devided triangles (as you suggested) seems more appropriate. So, now I have to deal with the questions above. I can't seem to wrap my mind arround what question to prioritize first. The answer to question 2. depends on how I deal with 1. and 3. If I want the indices stored in a certain way, I will have to traverse the QuadTree / BinaryTree in a certain way (whatever that will look like). The other way arround: When I store the sub-devided triangles in a certain way, they may predefine the indices of the vertices. I found this idea very inspiring and would like to know more. I will probably need the edges more often than the faces (pathfinding). Do I understand this correctly, when I say the following? I have a List of edges. When it is just the hexagon, I have 12 of them. 6 of those contain data for two triangles, the other 6 have only one triangle (the outer edges). I thereby have 3 references to any one triangle. When I call SubdevideTri() on any triangle, it will tell all three edges to SubdevideEdge() and then .... .... well, this is where my brain locks up .... To the point: @Gnollrunner Could you ellaborate on how you did this? How is your data stored? Do the edges contain the corners and the triangles? Why do I need the triangles stored in a QuadTree, when I already have their reference in the edges, stored in 6 BinaryTrees? What about the new edges "in between" midpoints? Or is the QuadTree of triangles the "dominant" storage? Do the triangles reference the edges? Do I really need the BinaryTree in that case? Or do you do both, to simplify access? I will try things out a bit and come back to you. Valueable knowledge, thank you for this! Thanks again for your support! Cheers!
  2. Hello dear graphics folk, I have a game that uses tiles of (flat-topped) hexagons. I want the hexagon to be separated into six triangles (n=0), and those triangles separated into another six*four = 24 (n=1) triangles, and so on... I (hypthetically) need the vertices of various depth for height-mapping (n=3), but also for pathfinding purposes(n=4) and structure placement(n=2). (See attached reference) I am using the Unity3d Mesh class and managed to create the hexagon with this page on hexagons. What I need is an algorithm that can tessellate the hexagon into triangles with depth n. I do not want to dublicate vertices (except where two hexagons meet, for simplicity). There seems to exist a button in Blender, which does exactly what I need. But I want to do it myself on runtime to use Perlin Noise (or similar) for height. Is there already such an algorithm? Do you recommend some resource? Maybe I am missing the right term to google it properly? To be more accurate: How do I find, count and order the vertices in a smart way, that makes constructing the triangles as elegant as possible?
  3. Hello dear AI folk, like I said in my Bachelor thesis post, I am done with my Bachelor thesis and the accomodating research project, that we discussed above. I wanted to thank you all for your previous feedback and to present you what came from it. I hope it is an interesting read (20 pages), should you care to have a look. I was very satisfied with this one (more so than with the BA thesis), even though it did not receive any grade. Again, feedback is very welcome, as I want to grow from it. Anyway, I felt like this thread was incomplete, if I did not post the result in the end. Thank you all for your suggestions! Even though they were frustrating at times, they really helped me to improve! EDIT: The piece is written to give other students a shortcut to what architecture they could pick, so it is addressed at beginners! PS. Both pieces seem rather Buzzfeed'esque to me. Maybe that's all you get in a Bachelor thesis? 732830_ThomasHaase_Research_GameAI.pdf
  4. Hello dear AI folk, I turned in my Bachelor (of Arts) thesis and received a grade (1.3 , where 1 == best, 5 == worst), that seems a bit odd to me. I guess, in the standard of our university it is rather fitting (a lot of people are artists, not coders), but I don't have a frame of reference in terms of where it ranks among the professionals (that is: you, dear reader) I would be very honored, if you read (or skimmed) through the 40 pages and gave me any feedback (maybe some grade). Otherwise I hope it is fun to read. I am not satisfied with what was accomplished in a pragmatic sense (due to time constraints), but also I am sure how I would continue and improve. I would be happy to discuss any possible future work. The reason for the highly positive grading given by my professor was due to the pioneer character of the topic. Still, I want to see how it holds up to your standards. I do want to improve. If you have suggestions on where to look next, do not hesitate to advise! EDIT: I will soon post a short summary on what I believe is my biggest mistake and how I would fix it. But right now, job search has priority. P.S. Thank you all for your previous feedback. I feel like my thesis benefited a lot from it! ThomasHaase_ImitationLearning_Bachelor_Documentation.pdf
  5. Dominus is a Sandbox game all about the player teaching multiple AI agents, one at a time, to perform better at gathering resources, building a town and getting happier. The player does so by briefly taking control (dominating) over an AI agent, showing the agent how to act by example. When control is released, the influence of the player’s behavior should be noticeable in the agent’s behavior henceforth. Sections 1 and 2 describe the motivation, why I want to make this bachelor thesis in this way. I see now that you, as helping people, do not need that information. I understand that reading this wall of text is frustrating and cumbersome. I did not mean to be disrespectful and thank you for pointing that out. My actual problem at hand: Choosing the right technology to achieve what is aimed for. The aim here, next to the teaching of behavior mentioned above, is to have a prototype able to scale well with new content created either by a developer or (wishful thinking, so optional) by a presumable player community. Another reason for a Goal-oriented approach is that fulfilling a need might be several steps away. (Grow Crops -> Make Flour -> Make Bread -> Eat) Learner’s question: Why would it be maleficial? What’s so bad about Coroutines? I get that a lot. I already assumed the project to be overscoped, but I thought I might personally learn more that way. Also, I went away from trying to create a huge economy to an Apple, a Tree, a House. Is that the kind of simplification of model you speak about? Off-the-shelf tools was UnityML Imitation Learning, but you already criticized it, too. For this reason, I intended to build a Utility-based AI as a Teacher, and make the Imitation Learning algorithm learn from that. That way I would have theoretical infinite data for the basic behavior. But it does not fix this problem: This is exactly the reason why I was feeling skeptical about ML as a solution for the problem, but I could not lay a finger on it. Also, this insight of yours on the matter is the reason for this thread. Thank you! I am not sure, where my mistake here is? When do I confuse the two? And how? I was sure that the player’s belief system would be paramount to the project, so the “ability of the computer” has to be created in dependence to that. I do see, however, that I am indeed confusing something. I hope I was able to clarify that. Where do you see potential for simplification? I can do that (is that the simplification?) Do you have any resources, you could spontaneously provide? I know, that is part of the work I am supposed to do, but it can’t hurt to ask, can it? If you shove me to a rough direction, that would awesome! Now an apology is in order: I did not mean to be disrespectful. I do see your point. I guess, I read and saw so much of him and about him that I mistakenly felt a more personal relationship than there actually is. That, in turn, tempted me to this impudent and provocative statement. It was very unprofessional and I apologize to him and to any reader. I am sorry. Should I, in any way, misstep in proper forum etiquette, or should you seriously dislike any styling of my post (e.g. many quotes in there today), please do not hesitate to tell me, so I can learn.
  6. Hello dear AI folks, now that I finished my Research Project, it is time to tackle the Bachelor thesis. Again I would like some feedback, as it worked out pretty damn well the last time. So here is what I want to do: 0. EDIT - Too Long; Didn't Read It was brought to my attention, that the first few paragraphs are mostly rambling. Sections 1 gives only vague background to the motivation. Feel free to skip. Here is a shorter description of the project: Dominus (working title) is a Sandbox game all about the player teaching multiple AI agents, one at a time, to perform better at gathering resources, building a town and getting happier. The player does so by briefly taking control (dominating) over an AI agent, showing the agent how to act by example. When control is released, the influence of the player’s behavior should be noticeable in the agent’s behavior henceforth. 1. Repetetive Tasks in Sandbox Games I don't know how much time exactly I spent in Minecraft, shoveling through dirt and punching trees. I do know, however, that I spent over a year (online time > 400 days) in World of Warcraft mindlessly grinding for better gear. Hell, even now that Season 14 in Diablo3 began, I spend more time flinging colorful pixels over the screen to see some counters go up (gold, xp). But I am oh-so-lazy. Can't the game do that for me please? Also, I miss my friends. I guess, I just hit that time of my life, when everybody is busy doing something new with their life in far away places. Alas, the Internet! We can game online, building something together in Terraria, Factorio, Space Engineers or 7 Days to Die. But not long after the server is set up and I am pretty much alone again. There is that one friend, that (as soon as he finds a shovel) sticks his head in the ground, only to be seen hours later with precious minerals. Another one is building a base camp on his own. Yet another friend is off screen fighting monsters. I am typically the one fiddleing around with redstone. I know, I know. It is a cooperation-thing. Everyone assumes a role and wants to shine in that role. But in DnD we do those things together, in the same place. We have direct impact on each other, rather than doing the same thing on our own for hours and hours to complete some greater goal. Maybe this is just the wrong kind of game for us. If we want action, why not just stick to action games? Well, after a great quest we want to return to something that is ours, that we made ourselves, home. If there is an action game with that sandbox element, like player created towns as in Ultima Online, we would probably play that. To be honest though, UO does not satisfy my friends visual needs anymore. 2. Bringing the band back together The dream of my Sandbox experience is to, at some point, reap the spoils of the mindless tasks all of us did before. This harvest of action packed Ender Dragon slaying is often days in the future, if happening at all (no, i haven't even seen the Minecraft endboss yet). I would wish for some automated process, that I can set up in a way to my liking, as in Factorio, and let it do its thing, while I take out my friends having fun storming the castle. In my case, I prefer NPCs over conveyer tubes. I want "Hey, there is the blond guy with that yellow shirt. I shall name him Bob, and I will build him a house now!" But differently from Dwarf Fortress, I also do want direct control over what Bob is doing. I couldn't stand seeing him eaten by a Wear-Mammoth, while he is crying in the woods over his dead cat. Also, I would like to be able to show him, that he can actually carry more than one log of wood. So when he is out there lumbering away, he can bring some for his NPC-friends. He does not have to do it in the perfect way, but in my way. And while Bob is getting firewood, and some Charlie (NPC) is baking bread, Darla (NPC) is forging armor, I can take Anna (NPC) out to a trip to the dungeon, together with a friend of mine, who took a liking to Fenya(NPC). The repetetive tasks is left to the common town folk, while my friends and I are out there having fun. 3. Games, that do the job not quite as I want them to I already mentioned Minecraft, the origin of the problem. Everyone is doing something somewhere else. Then there is Factorio, which tries to fix that problem with conveyer belts and automated workshops. Still, you spend the most time building more of the same. A direct cooperative effort can lead to chaos in the clockwork. In Dwarf Fortress you can see NPCs with unique character, goals and needs. There are short-, mid- and long-term goals keeping you, as the player, busy until the inevitable Dwarfocalypse. But those Dorfs can be pretty frustrating at times. The creature from Black and White was, at times, equally frustrating. But given enough blood, sweat and tears you were able to teach it to help you out quite a bit. And while it was doing its thing, I had fun throwing rocks the size of a beluga whale at my enemy. In Dungeon Keeper you were able to dominate a creature, enabling direct control, turning the strategy game into an action game for a while. 4. Occam's Razor - The holy grail is carved out of wood This is just a Bachelors degree. I actually have to remind myself of the fact multiple times. I will simply not be able to create the one Game of games. On my own I will probably not even be able to do more than a prototype. I looked at the Maslow Pyramid and thought "I want all of that!". I looked at the Dwarf Fortress wiki about the production chain and though "I want all of that!" Well, no. Just no. For the purpose of a prototype, there will be an apple-tree, a wooden hut, an axe and three or four characters that want to sleep and eat. That makes them happy, which in turn makes them pick apples, chop trees and build houses faster. The prototype should be able to add more content later on, though. Ideally, this would happen with a wizard in the editor. 5. Technical stuff - The road so far With the requirements seen above, a Goal-oriented Behavior-approach seems rather fitting: Give the AI system some goal and some action and it figures out how to use them on its own. One could even argue that I probably read the book Behavioral Mathematics for Game AI first, and only then decided to build a game for that. Well, okay, you got me. For me it was like seeing some cool Magic - The Gathering-card and deciding to build a deck around it. I know that, at this point, a simpler AI structure would suffice, but I am stubborn in applying what I learned in the book. So, as Ian Millington suggests in Artificial Intelligence for Games (p403), actions are "generated by objects in the world" using a Command pattern. As I am most comfortable with Unity3D, Coroutines are already built in the system, so I can spread out the computation of action scores over several frames. I have sensor to determine the distance to objects. I will have sensors to determine the satisfaction of needs and for how much satisfaction an action provides. My utility functions are eagerly waiting to have more than a Linear Interpolation. All actions are already in the game: you can eat, sleep, pick up and drop. There is already a pig running about, eating the closest apple it can find (including the ones in your inventory) 6. My Problem - Suggestions welcome The working title for the game is Dominus. You do not have a player avatar, that can directly interact with the environment. Instead, you have something like a mindcontrolling Blob, that can sit on someones head and dominate a NPC, giving you direct control over the NPC and thus allowing you direct interaction. What is supposed to happen is this: While dominating a NPC, the AI system is supposed to record what you are doing, as long as the NPC is still happy (fed and rested). When released from domination, the NPC is supposed to recreate that behavior in a similar fashion without neglecting their needs. Example: The base AI set up by the developer is not perfect, not even close. So, Bob is hungry and moves for 20 seconds to get an apple from a tree. He eats the apple. Bob is now sleepy. He walks 15 seconds to a hut, then goes sleeping. He is now hungry again. What the player knows, is that it would probably have been smarter for Bob to collect some more apples, to later consume them from the inventory. So the player dominates Bob, walks to the tree, collects apples until Bob's inventory is full, walks back to the house and goes sleeping, then releases Bob. When Bob wakes up, he will of course eat apples from his inventory. But the next time he goes apple picking, he fills the inventory to a degree, similar to what the player has shown him to do. My Concerns: I see no way of implementing this with Utility-based AI. It would probably need some system that automatically changes weights or functions on runtime. But how should it know, why the player did what he did? I heard that the author of Behavioral Mathematics for Game AI pretty much loathes Machine Learning, so I am interested in alternatives to the following: Imitiation Learning seems to be capable of doing what I want. My idea would be to create the Utility-based AI first, then let the Imitation Learning algorithm imitate that behavior to not being able to distinguish one from the other. Then the Imitation Learning algorithm takes into account what the player does. My professor is absolutly hyped about Machine Learning and wants me to do it that way. But I am sceptical. In my Research Project I even wrote (shamelessly citing myself now ...) I don't want to make the mistake, which I warn beginners about. So what do you guys think? Imitation Learning? "Enhanced" Utility-based AI? Something else? To me this sounds a bit like a discussion around the AI Wish List. Maybe there are some other resources for me to look into? I am interested in your oppinion! Cheers, Rockroot P.S. If you are interested, here is the git repository. I have to update/commit soonest. Warning: bug infestation! Some pictures are attached.
  7. The paper is done! and I would like to have your feedback on it. There is not a lot of new stuff in it, so it is more informational work than actual research, i guess. But I learned new things along the way and I was hoping for you to point out, again, where I might have misconceptions. It is 28 pages strong, so I won't force anyone to read it. Also, it is not the actual Bachelor Thesis. Sneak Peek: If you want to read the full paper, please do PM me. I will upload it here soonest, but at this point I will wait for my teachers to grade it, to avoid accusations of plagiarism. I was allowed to send it via PM, though. My Bachelor thesis will be titled: Imitation of Player Behavior in Sandbox Games using Utility-based Rational Agents and I would be glad to have some discussion (or have someone nudge me to interessting resources) Doing the Scrooge McDuck-dive into the GDC Vault now, Cheers,
  8. Thank you all for your highly regarded feedback! First off, it was obviously a false assumption on my part, that ripping a piece of my work out of context and presenting it would be giving me the answer I, in a way, desperatly wanted: That it is perfect, and done, and I can go play with my daughter. On the other hand, I want to grow from this, and I am doing so by the minute. To give some context of my situation: This work should not be considered as a scientific paper (it might be more suitable as a Gamasutra-article ... or Buzzfeed?). The professors at my university (Digital Media: Animation & Game) had the ingenious idea, that students should prove their ability in researching skills in an essay in 20 pages and 6 weeks of time. This work is to be done next to a prototype of a game (or animation) and 40 pages of documentation (12 weeks). In the years before it was common, that students just do 60 pages on the latter skipping the research part all together. I can see the rational behind it, but I would be glad to write 60 pages about the above thesis, given I had enough time. Also, I was told to write on a level, so that other students (2nd to 3rd semester) "would bleed less by reading my work, than by rumaging through the same journey". I read the Book of Lenses (in parts) for a project at the time. It was great to work with, but it was hard to convey the ideas to my fellow shoot-from-the-hip students ("I liked playing this game, and that one; I'm gonna mash them together!!"). Game design patterns may be useless when creating a new game. I suppose, they are constraining the creative process. But they can give an anchor to a discussion, a nomenclature of what is being talked about. That's why I think they can be viable at times (and I should add that line in my paper I guess) Next of, I am an outsider. But I want to change that. Some years back I dipped my toes in AI as an intern, working on a (kind of) AAA title (and I do dislike publishers ever since). My (rather) futile task was creating a GUI for the behavioral AI inside the map editor. To unfold the mysteries of the AI's working, I was given "Behavioral Mathematics for Game AI" (Mark). I couldn't let go of the concept and this is why I am learning about AI in progress of writing a bachelor thesis about it. To get back to topic: Well, that was exactly the thing that I was trying to prove. Sadly, I do not have the time for a fresh start. Luckily though, it is viable to conclude the bachelor thesis with exactly that finding: it's not about the architecture selection. There is a german idiom: "Konsequenz heißt, auch Holzwege zu Ende zu gehen." It roughly translats to "Being consequent means to also walk the wrong track to finish." So I did two things: I brutalized 200 pages of chapter 5 (Decision Making) of "Artifical Intelligence for Games" (Millington, Funge) into 8 pages of explaining said architectures. Then, I found that swedish master thesis "Game Design Patterns for Stealth Computer Games". And now I am trying to find connections from one to the other. It seems rather pointless now. To support my statements, i chose two articles from the Game AI Pro-series: How to catch a Ninja and Modeling Perception and Awareness in Tom Clancy’s Splinter Cell Blacklist. Neither of them treats the problem the way I want them to. And that is, what I meant with the whole "secretive developers"-thing. I see now, that it is not about secrets. Writing about the AI architecture in comparasion to the game's mechanics just isn't that interesting. But I still wonder, why? (It seems to be a prinicpal question for newbies ...) EDIT: Thinking about the all-mighty burrito, I came up with my own metaphor: When people go on vacation, they pack certain things. On a camping trip you should pack a tent, provisions and some means of cooking device. Depending on the weather, you should pack sunglasses (camping at a lake?) or a winter coat (Himalaya?). This, of course, is different from having a vacation in a 5-starred hotel. All good and well, but what I am interested in is: What car did you use to pack the tent and other things, and to go there? Was it a racecar? A truck? Or a train? (Et voila, your food is now a car) There must be some kind of relation there, or does it not? To explain the metaphor: The vacationists reporting about their trip are, in my mind, the AI developers. Camping is one kind of vacation, like a game can often be categorized as one kind of game type. The tent and other things are comparable to what makes this one AI in this one game special (like the way enemies detect the player). The means of transportation, thereby, is the underlying AI structure. Do you see my point? Or is my assumption about the what-is-what askew (or plain wrong) again? I will keep the daunting task of answering to your concerns for a little later. For now I should get back to work. Again, I really appreciate your feedback. Even though my self-confidence is, in a way, shattered, I enjoy that I finally came out of my box and joined a community. I hope to lose the [Young]-tag soon. Cheers PS. @Dave Mark, I read your Culinary Guide before and I loved it. My favorite quote: It depends. I fear that I am trying to do the same thing as you already did, but worse (or at least less informed).
  9. First off, thank you, Kylotan, for your feedback. I'm a bit baffled by my own false assumptions. Thank you for pointing that out. I guess, one or two of your concerns can be fixed with reference to the work done in the paper: I will come back to you about this. You did me a great deed for the Evaluation-part of the paper aswell, thanks again. However, that does not make me any less panicy. But holding my hand was not the point of this post anyway, or was it.
  10. Hello dear AI folk! I picked up a passion for Game AI a while ago and I wanted to join a community for a while now. This seems to be the right place to get cozy. Now, for my bachelors degree, I am supposed to write a research essay (about 20 pages). I chose to title it "Comparing Approaches to Game AI imder Consideration of Gameplay Mechanics". In the essay I am making bold statements, concerning the state of related work in the field. I want to know, if it holds up to reality. And what better way to find out, than asking the community of said reality? Disclaimer: This is the first research paper I have ever done and it is work in progress. I feel that I suck at this. The main question is: Does the above statement hold up to reality? But please don't shy away from corrections or general advice. I would also like to share the completed work as soon as it is done, if anyone is interested. I am in dear need of some feedback, that I personally can grow by. Cheers
  • 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!