Jump to content
  • Advertisement

Search the Community

Showing results for tags 'C++'.

The search index is currently processing. Current results may not be complete.


More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Categories

  • Audio
    • Music and Sound FX
  • Business
    • Business and Law
    • Career Development
    • Production and Management
  • Game Design
    • Game Design and Theory
    • Writing for Games
    • UX for Games
  • Industry
    • Interviews
    • Event Coverage
  • Programming
    • Artificial Intelligence
    • General and Gameplay Programming
    • Graphics and GPU Programming
    • Engines and Middleware
    • Math and Physics
    • Networking and Multiplayer
  • Visual Arts
  • Archive

Categories

  • Audio
  • Visual Arts
  • Programming
  • Writing

Categories

  • Game Dev Loadout
  • Game Dev Unchained

Categories

  • Game Developers Conference
    • GDC 2017
    • GDC 2018
  • Power-Up Digital Games Conference
    • PDGC I: Words of Wisdom
    • PDGC II: The Devs Strike Back
    • PDGC III: Syntax Error

Forums

  • Audio
    • Music and Sound FX
  • Business
    • Games Career Development
    • Production and Management
    • Games Business and Law
  • Game Design
    • Game Design and Theory
    • Writing for Games
  • Programming
    • Artificial Intelligence
    • Engines and Middleware
    • General and Gameplay Programming
    • Graphics and GPU Programming
    • Math and Physics
    • Networking and Multiplayer
  • Visual Arts
    • 2D and 3D Art
    • Art Critique and Feedback
  • Community
    • GameDev Challenges
    • GDNet+ Member Forum
    • GDNet Lounge
    • GDNet Comments, Suggestions, and Ideas
    • Coding Horrors
    • Your Announcements
    • Hobby Project Classifieds
    • Indie Showcase
    • Article Writing
  • Affiliates
    • NeHe Productions
    • AngelCode
  • Topical
    • Virtual and Augmented Reality
    • News
  • Workshops
    • C# Workshop
    • CPP Workshop
    • Freehand Drawing Workshop
    • Hands-On Interactive Game Development
    • SICP Workshop
    • XNA 4.0 Workshop
  • Archive
    • Topical
    • Affiliates
    • Contests
    • Technical
  • GameDev Challenges's Topics
  • For Beginners's Forum
  • Unreal Engine Users's Unreal Engine Group Forum
  • Unity Developers's Forum
  • Unity Developers's Asset Share

Calendars

  • Community Calendar
  • Games Industry Events
  • Game Jams
  • GameDev Challenges's Schedule

Blogs

There are no results to display.

There are no results to display.

Product Groups

  • Advertisements
  • GameDev Gear

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Website


Role


Twitter


Github


Twitch


Steam

Found 500 results

  1. I have two curves. One handdrawn and one is a smoothed version of the handdrawn. The data of each curve is stored in 2 seperate vector arrays. Time Delta is also stored in the handdrawn curve vector, so i can replay the drawing process and so that it looks natural. Now i need to transfer the Time Delta from Curve 1 (Raw input) to Curve 2 (the already smoothed curve). Sometimes the size of the first vector is larger and sometimes smaller than the second vector. (Depends on the input draw speed) So my question is: How do i fill the whole vector PenSmoot.time with the correct interpolated values? Case 1: Input vector is larger PenInput.time[0] = 0 PenSmoot.time[0] = 0 PenInput.time[1] = 5 PenSmoot.time[1] = ? PenInput.time[2] = 12 PenSmoot.time[2] = ? PenInput.time[3] = 2 PenSmoot.time[3] = ? PenInput.time[4] = 50 PenSmoot.time[4] = ? PenInput.time[5] = 100 PenInput.time[6] = 20 PenInput.time[7] = 3 PenInput.time[8] = 9 PenInput.time[9] = 33 Case 2: Input vector is smaller PenInput.time[0] = 0 PenSmoot.time[0] = 0 PenInput.time[1] = 5 PenSmoot.time[1] = ? PenInput.time[2] = 12 PenSmoot.time[2] = ? PenInput.time[3] = 2 PenSmoot.time[3] = ? PenInput.time[4] = 50 PenSmoot.time[4] = ? PenSmoot.time[5] = ? PenSmoot.time[6] = ? PenSmoot.time[7] = ? PenSmoot.time[8] = ? PenSmoot.time[9] = ?
  2. In my most complex gameplay source file (single .cpp) with a lot of necessary #include, ... whenever I edit it (e.g. add a single space character), it needs to recompile 40 seconds. Linking takes only 3-5 seconds. Is it what to be expected? Do you also face this issue? Should I just buy a new computer or more RAM? I am using Visual Studio 2017. I am not using Unity Build (single compilation unit technique). Just thinking that the cause is my code, I can't eat and sleep well. It also induces nightmare at my bedtime. Please help.
  3. So I've spent my spare time the last couple of months finalising small3d framework's migration to Vulkan and also making sure the framework runs on iOS and Android. I got my "Avoid the Bug" game running on my mobile phone and my iPad (in addition to the desktop OSes where it has already been working for a long time). I thought that I wouldn't have any time left for the fall 2019 challenge. Nonetheless, I managed to put a little something together. The game is called Gloom. It must be the ugliest game I have ever made, but hey, it runs on Vulkan and it has taken my little small3d framework to where it has never been before. I have a player moving through a map (which is read from a text file) while eliminating enemies. All of this runs on the standard small3d version 1.8 with no modification of the framework itself whatsoever. So anyway, I am not saying I hope you like the game (you probably won't) but I do hope it is good enough to fulfill the challenge requirements :)
  4. Hello everyone, I appreciate any help i can get. So i recently started getting this message listed bellow in visual studio when i would compile any game i have for UE4.23.0. 1>EXEC : [1/28] error : Unable to create child process I have no idea how to fix this, and also i really don't want to have to set all the classes again in a new project. Second thing is that i can not move my Character on the Sever when testing multiplayer after adding "Role = ROLE_Authority" to sections in an AI Tracker bot class that i created as a part of Tom Loomans Course on Udemy. I am not following Tom Loomans course 100%, Do i need to add sever implementation to my character because i am using different movement code then what Tom uses? I Am happy to share some screen shots if needed. Please help, thankyou for your time.
  5. phil67rpg

    OpenGL rotate ship

    I have a very simple question, I am trying to rotate some vertex's around an arbitrary axis. basically I want to use glRotatef and glTranslatef to rotate a space ship I have drawn on the screen. here is my code of my ship. what it does do is rotate around the origin when I use the arrow keys left and right. void drawShip() { glPushMatrix(); glColor3f(255.0f, 0.0f, 0.0f); glTranslatef(-50.0f, 0.0f, 0.0f); glRotatef(rotateship, 0.0f, 0.0f, 1.0f); glBegin(GL_LINE_LOOP); glVertex3f(50.0f, 0.0f, 0.0f); glVertex3f(45.0f, -5.0f, 0.0f); glVertex3f(50.0f, 10.0f, 0.0f); glVertex3f(55.0f, -5.0f, 0.0f); glEnd(); glTranslatef(50.0f, 0.0f, 0.0f); glPopMatrix(); }
  6. I've worked through loading of cut-scene data from the JSON files, and am now figuring out how I want to load cut-scene assets. I'm mostly typing up this blog entry as a way of documenting this to myself. Cause thinking through this is a little bit hard. 😓 When you hear "cut-scene", you might be thinking that I'm just going to play a video file before each level to provide some narration. Nope, I wanted to make use of the game engine instead. Cut-scene definitions are kind of like scripts that indicate which map to display, have the snake move around the map, make things appear, etc. on a timeline. My hope is that this will make cut-scenes feel like you're part of the narration... Many games we play will pre-render video files, often looking way better than the game itself -- I've always felt like I'm being taken out of the game when this happens. In my head, the opening of story mode will show the snake moving through several areas before reaching the first playable map. Background music will play, some narration occurs, and then the game begins. Anyway, the challenge I'm facing now is that I decided to allow cut-scene definitions specify as many maps as the level designer chooses. Currently, the "StoryLevelAssetBundle" class I wrote only allows for the level's main map and its textures to be stored. I now have to expand that to store multiple maps across potentially up to three cut-scenes (one played before the level, another if the player loses, and another if the player wins). It's also possible -- even likely -- that the same textures will appear across those maps. It's even possible that the same map could appear several times. So here's what I figure I need to do... Note that I'm using the phrase game map in an attempt to distinguish it from the C++ unordered_map. Loop through each cut-scene's event list to find all the references to game maps. Load the game map definitions for them, probably keeping them in a std::unordered_map, keyed by game map filename. It's probably still best to keep the level's playable game map asset separate -- during game play we want it easily accessible. Loop through each game map definition, in order to load all the game map-related textures. To avoid loading the same texture multiple times, keep all textures in a std::unordered_map, also keyed by game map filename. If a texture has previously been loaded, we'll now know. While looping through the game map definitions, we can also store the floor and barrier texture references in separate std::unordered_map's, keyed by floor or barrier ID. However, the values will be pointers to the sf::Texture objects previously loaded. I believe the game maps used within cut-scenes will need to be in a nested container structure. Now that I have that written down, time to implement it! I've worked out in my head exactly how the silly "Adam's Revenge" story will go, and I'm really looking forward to getting over this hump of being able to play opening cut-scenes before each level. We have our Thanksgiving weekend here in Canada, and this is how I'll be spending it (well, the non-family part of it at least). 🤣 The fate of the world is in your scales...
  7. What could be a way of avoiding using inheritance and virtual methods when designing components for an entity-component-system? I'll be more specific about my design issue: I currently have different classes for different kinds of colliders (let's say, CircleCollider and LineCollider). My system that checks for collisions and updates the positions and/or velocities of my entities should be something like: for entity_i in alive_entities { collider_i = get_collider_of_entity(entity_i) // components of same kind are stored contiguously in separate arrays transform_i = get_transform_of_entity(entity_i) for entity_j in alive_entities { collider_j = get_collider_of_entity(entity_j) transform_j = get_transform_of_entity(entity_j) if check_collision(collider_i, collider_j) { update(transform_i) update(transform_j) } } } my problem is that I don't have a generic `get_collider_of_entity` function, but rather a function `get_circle_collider_of_entity` and a separate one `get_line_collider_of_entity`, and so on. (This happens because under the hood I am keeping a mapping (entity_id -> [transform_id, sprite_id, circle_collider_id, line_collider_id, ...]) that tells me whether an entity is using certain kinds of components and which are the indices of those components in the arrays containing the actual components instances. As you can see, each component class is corresponding to a unique index, namely the index position of the array of the mapping described above. For example, transforms are 0, sprites are 1, circle colliders are 2, line colliders are 3, and so on.) I am in need to write a system as the one in the snippet above. I can write several overloaded `check_collision` functions that implement the logic for collision detection between different kinds of geometric primitives, but my problem is that I am not sure how to obtain a generic `get_collider_of_entity` function. I would need something that would get me the collider of an entity, regardless of whether the entity has a circle collider, a line collider, a square collider, etc. One solution could be to write a function that checks whether in my internal entity_id -> [components_ids] mapping a certain entity has a collider at any of the indices that correspond to colliders. For example, say that the indices related to the collider classes are indices 10 to 20, then my function would do get_collider_of_entity (entity_id) { for comp_type_id in 10..20{ if mapping[entity_id][comp_type_id] not null { return components_arrays[comp_type_id][entity_id] } } return null } This could turn out to be pretty slow, since I have to do a small search for every collider of every entity. Also, it may not be straightforward to handle returned types here. (I'm working with C++, and the first solution - that is not involving inheritance in any way - would be returning a std::variant<CircleCollider, LineCollider, ... all kinds of components>, since I would need to return something that could be of different types). Another solution could be having some inheritance among components, e.g. all specific component classes inherit from a base Collider, and overrride some virtual `collide_with(const Collider& other)` method. Then I would redesign my mapping to probably reserve just one index for colliders, and then I would actual colliders in a polymorphic array of pointers to colliders, instead of having a separate array for CircleColliders, another for LineColliders, and so on. But this would destroy any attempt to be cache-friendly in my design, wouldn't it? That's why I am looking for alternatives. A third alternative would be to just have a single, only, Collider class. That would internally store the "actual type" ( aka what kind of collider it is ) with dynamic information (like an enum ColliderType). Then I would have all colliders have all members needed by any kind of colliders, and specific collision detection functions which I can dispatch dynamically that only use some of that data. (Practical example: a "Collider" would have a radius, and the coordinate for 2 points, and in case its type was "circle" it would only make use of the radius and of one of the 2 points - used as the center -, while if it was a "segment" it would only make use of the 2 points). My gut feeling is that this would bloat all colliders, and, even if the bloat could be reduced - using unions in some smart way for storing members? I wouldn't know how -, then still the design would be pretty brittle. I'm clueless and open for ideas and advice! How do you handle in general situations in which you have components that can be naturally modeled as subclasses of a more generic component class? Inheritance? Smart hacks with variants, templates, macros, custom indexing? Dynamic "internal" type?
  8. I have worked on this problem for several days. I have almost solved my problem. I have got my sprite to move up and down continuously using the mouse. this done by using the glutTimerFunc function. I want the mouse to get the sprite to move up and down once. I have googled and debugged my code. I have also taken some JavaScript code and ported it over into opengl. let me know if you need my question to be more specific. here is my code so far. bool onGround = false; void StartJump() { if (onGround) { velocityY = -12.0f; onGround = false; } } void EndJump() { if (velocityY < -6.0f) { velocityY = -6.0f; } } void Update() { velocityY += gravity; positionY += velocityY; positionX += velocityX; if (positionY > 25.0f) { positionY = 0.0f; velocityY = 0.0f; onGround = false; } } void Loop(int val) { Update(); drawSprite(); glutPostRedisplay(); glutTimerFunc(33, Loop, 0); } void mouseClicks(int button, int state, int x, int y) { if (button == GLUT_LEFT_BUTTON && state == GLUT_DOWN) { StartJump(); } if (button == GLUT_LEFT_BUTTON && state == GLUT_UP) { EndJump(); } } void handleKeypress(unsigned char key, int x, int y) { switch (key) { case 27: exit(0); break; case 32: Loop(0); break;
  9. Dear reader, for my long term hobby project I'm looking for additional contributors/ one or more partners in mind that could take the challange and bring some fresh air into the project. Are you in search of a challenge and want to support all those game developers out there seeking for something lightweight to make their great creations or do you ever liked to make your game from scratch developed with state-of-the-art technology? Then this might be your chance! I'm a long time gamer, designer, developer, board game fan and hobbyist board game author, passionated in games since age of 6 with addiction to video games. Working as senior in the games industrie at day, at night tinkering at my very own game engine and ideas for games I want to make with it popping into my mind from time to time. After some iterations and a straight learning curve I felt ready to publish some pieces of my work to GitHub and now want to find a team or partner or any contributors that don't want to be part of a team but anyways feel inspired to make something on their own, to inspire each other and get new prespectives on this huge but very interesting topic and keep motivation up and running. The Framework I started to be interested in game engines arround 21 years ago growing up with Unreal Engine and some popular products like A8 Engine I always had the dream to create something on my own that I could use to easily bring my ideas to life. The framework is on a non-commercial base designed with performance and the goal of customization but also simplicity in mind. This is the reason I decided to have not just a package manager but also a custom build tool to have any user work how he/she likes with their favorite IDE and compiler on their favorite platform. It is planned to have the product work on an ammount of platforms (where Windows is currently the only platform supported but Linux/Android and hopefully one day Sony and Nintendo are on my target list too) where the framework should work on any platform that supports .NET/ Mono and C# 4. I'm always intended to improve the workflow whenever possible! Your Tasks Further develop and improve already existing features and modules Design, prototype, implement and test usefull features and modules Keep an eye on the code because I'm just a human too; humans make mistakes Maintain the public reposetories at GitHub and related resources Requirements Because I already worked together with some people interested in the project At least some experience on the generalist level in C++ and/or C# Experience in using command line tools Knowledge about build-pipelines, build-tools and at least one common IDE like Visual Studio Good communication skills and a reliable response time Disciplined self-reliant and motivated work style Fluent in spoken and written English A Discord account At least 5 hours per Week to work on this project Considered a Plus Knowledge of the German language As passionated as I am for all aspects of game development Working as professional in the industry too, especially in engine/ tools development I offer No money because I'm working for non-profit in my spare time and at my own charge, but a friendly, motivated and passioned teammate in a highly professional work environment and technical knowledge from a long-term industrie professional. Dear reader, thank you for taken the time to read the full post and if you have any questions or want to work with me/us, please feel free to send a PM or Discord Message with a short introduction and a brief time schedule so I/we have an overview to plan further development. Thank you in advance! Stay tuned and take also a look at the list of related posts https://www.gamedev.net/forums/topic/701876-2dconcept-artist-for-hackn-slay-arpg/
  10. Hi, I have interest developing Game Engine.But,you know it is very difficult and sometimes i feel unmotivated.So,I look for programmers who has passion about it.We will learn topics,then talk about them on Discord,so we will help one another and will learn faster.And we can build very good portfolio together.If you are interested pls send mail me => mr.vasifabdullayev@gmail.com
  11. It seemed best to start another thread for this instead of derailing the thread the conversation started in and maybe to get some other opinions. That's definitely clever, but it feels like you're just trading one compiler trick for a different compiler trick. Do you think this one is better because it's somehow "more C++" than the sizeof version? I have two issues with this code. Firstly I think it's too complicated and clever for it's own good. Even setting aside the new-ness of constexpr, this requires an understanding of templates and template parameter deduction that can take a while to understand. I have a hard enough time with other programmers doing templates right with trivial type deduction that this could make their head explode. Secondly, now that this is a function it's got to live somewhere which means either duplicating it in every header that uses it (bad) or putting it in it's own header (or a utilities header) and including it. This point is more personal preference than anything else since it feels like such a trivial operation to include a header for. I've definitely seen code that wraps the sizeof trick in a macro, but I think that's silly too since that has the same dependency problem as this function. I don't think many people would make a macro/function to wrap "+= 2" just because it happens to occur in multiple places in the code. I don't want to come off as argumentative here @a light breeze. I'm not claiming to be right or that you're wrong or that there's even a right or wrong to be decided here. I'm honestly just very interested in the why of how people decided the things they find acceptable or not. And when someone uses a phrase like "has no place" I immediately want to explore that!
  12. Hi, I'm trying to find a bug in my game that causes it to crash on Windows 7. It crashes (almost) reliably when I do a specific thing in the game, but only on Windows 7 and only in the release build (without debug heap). It's some access violation reading from address 0000 0xxxx xxxx xxxx (it's always those 5 0's and a "random" number, weird). I'm testing my game on Windows 10 and this never happened in months (or years). On Windows 7, it crashed randomly and when I looked at it I actually found 2 problems and fixed them and now it crashes more often. The problem with the error is: The game crashes at some point in time when I allocate or free memory in a different thread. I even tried to write code that causes such an error (to help me locate it) but everything I try makes it crash immediately. How do I find the source of such an error? I would use the debug build but it just doesn't crash in the debug build. And I can't go through 50K lines of code. I'm using several libraries but I doubt it's one of those. Their behavior shouldn't change on a different version of Windows. Thanks in advance for your help!
  13. Since my last update, I've added dangers / traps to story mode. I've also added some minor visual enhancements, and have rough versions of the first three levels of the story mode campaign. I figured I'd release an early alpha version of story mode at this point, which you can find here: https://github.com/ryantherileyman/riley-basic-games/blob/master/garden_of_eating_story_alpha_1_2_0.zip Currently, the levels are actually in reverse order. I only did this because it made it easier to jump into the most recent level I was working on for play testing. So for anyone who tries it out, just know that the levels get progressively easier, instead of harder. 😅 You can even try your hands at creating your own maps and levels. The story mode wiki page explains how to do so -- all you need is a text editor, and basic knowledge of JSON. The screenshot below shows an example of a spike trap hurting the snake. The snake's eyes now turn into "X"s momentarily when taking damage. And this is a screenshot from level 3 of story mode. Each level gets progressively harder in some way. This can manifest a number of ways: faster snake speed, more barriers, food spawning patterns that encourage the player to wrap the snake in on itself, or traps. I also added text that floats and fades away when the snake eats a food item, showing the scoring information. Players get bonus points if their path to the food was as short as possible.. New Features Identified From my GitHub wiki page on story mode, I've identified a number of features I'd like to work into story mode. Most of these came to me while designing the first three levels. Lots of "it would be neat if..." moments! Additional triggers for spawning food or traps. Triggers for custom sounds to play. Triggers for dynamically changing the barriers on the map. (Lower priority) Show a scoring summary after each level. (Lower priority) Up Next - Cut-Scenes As I get further and further on level design, I was really feeling the importance of getting support for cut-scenes into the game. I'm at that point now where I'll be tackling it head-on. The new feature above "triggers for custom sounds to play" is intended to complement the story telling aspect of the game, and is something I plan on tackling alongside cut-scenes. You'll be hearing a narration of sorts when certain things happen. Fun things ahead! (I hope not just for me, ha! 🤣 )
  14. Hi. I have no idea what's going on here. I understand that macros are used to paste code where the macro is located, and that they can take parameters in their use, but this exceeds me. What I understand is that using macros first sets the header or signature of a function (GetTransitionTable), and inside, defines a static variable TRANSITION_TABLE, which is an array. With the following macro, TRANSITION_ENTRY, fill in the array, I suppose doing an implicit construction of objects, and converting the parameters into the objects expected by the potential object of each element of the array. Finally add a null element at the end. Then, in the use of macros, pass the states they expect to fill in the array. Do you basically use the macro to save writing much more repeated text than you would have to write if you didn't use it? Is this use correct? In The C ++ Programming Language, Bjarne Stroustrup, apart from practically not addressing the issue, seems very contrary to the use of macros. Thanks. Used as:
  15. Hello, I need a tool which can generate c++ code, more precisely - for each string in some file to generate one header and one cpp file, and to add some functions in several files. What do you guys use in such scenarios? Of course I can write such generator myself in Python, but if you have better advice I would listen.
  16. I've been quiet here on gamedev for the past two weeks, but only because I've been busy getting story mode operational. Since my last update, I've managed to get all the core aspects of story mode functioning. Referring back to my wiki page on GitHub, I've completed points 1 through 3 and point 8 (because it was easy and natural to do so at the time): Levels will load dynamically, progressing the player through an entire campaign to completion. All types of win conditions are supported. The level designer has the choice of: number of a particular food item eaten, length of snake, or time survived. The level designer can define a maximum snake health. Hitting a barrier only causes the snake to lose a point of health. Eating food scores points. The game keeps track of how far the snake moved from the time food spawned, up to the time it was eaten. Bonus points are scored if the snake moves the shortest possible path. Multiple food spawns are supported, with carrots being the extra type of food supported so far. Each new type of food will have pre-determined characteristics; for carrots, they give a low score, but also heal the snake by a small amount. Story mode adds a "food spawned" sound effect that isn't present in quick mode. I also spent some time blending grass textures together to help spruce up the visuals a little bit: As soon as I got the second type of food spawning, and tested out being able to spawn multiple food instances, the game actually got kinda fun. I'm quite happy with how it's all coming together. 😀 Now it's time to start thinking about the actual story behind Story Mode! I have a basic outline floating around in my head, but need to flesh out the details and figure out how that will translate into the actual game play. In terms of features, the next smaller thing I want to add is "dangers". The first danger I'll add will be a spike that comes up from beneath the ground, causing damage to the snake if its body is present on that tile. In terms of level design, I have the ability to set where both food items and dangers will spawn. So I'll be able to provide a visual cue that certain tiles are dangerous; and avoid having food spawn there. Food might spawn near such tiles, though -- gotta make it a challenge! And the next major feature will be cut-scene support. I'm expecting this to be a fair bit of development work... but hopefully also a lot of fun o