Jump to content
  • Advertisement
    1. Past hour
    2. Lactose

      blackjack game

      There is almost no code, so there's almost nothing to say. This is like saying "I'm going to write a book, and so far I have a main character called John. Is my book any good?". The only real comments I have on your code is that the enums could have more descriptive names (Hearts instead of H, etc.), and that currently your face enum doesn't support values of 1-10. And that you're including time.h, when no part of your current code uses it. Oh, and "using std" is generally not a good idea, because it can cause naming conflicts in larger projects. For such a tiny project it's probably not a huge deal, but I thought I could mention it. If you want proper feedback, you're going to have a lot more to show. Preferably a working version of the game.
    3. phil67rpg

      blackjack game

      well I am making a text based blackjack game I am unsure of how to progress. here is the skeleton of my program. I am going to work on this more, and do some research on oop design. I don't want code. I am just trying to be a better programmer. I am also learning how to program in oop paradigm. #include <iostream> #include <time.h> using namespace std; enum suit { S, H, D, C }; enum face { J = 11, Q, K, A }; class card { private: public: }; class deck { private: public: }; int main() { system("pause"); return 0; }
    4. I think its disgusting and pathetic that anyone could even think of sending a death threat over a sodding game. We had awful quality control back in the early days of gaming that made us rage until the neighbours started banging on the walls, but we just accepted it as a shit game and got on with it. Probably have a laugh about it with our mates while the more passionate ones would send a letter of displeasure to one of the gaming magazines... I've gotten upset over a lot games over the decades - most recently that !£$&ing Diggernaut* from Samus Return - but I honestly could not bring myself down to that level of childishness. For anyone here who has received such bullshit in the post - you do not deserve any of that crap, but they most definitely do deserve a visit from Robert McCall. * If you are the individual responsible for the Diggernaut in M:SR...go and stand in the corner of the room you currently occupy...and think about what you have done! But thanks for bringing Metroid back to us all the same...
    5. Scouting Ninja

      Advanced gear in the wilderness? (fantasy rpg)

      Is this like the infinite tower idea? Because it sounds like the problem is with returning and not actually finding valuable items. So maybe the path back has like a timer. When a player defeats enemies in a zone, it takes time for the zone to fill up again. This way returning early is easy but deciding to venture too far could make the way back just as dangerous as the journey. If it a problem with finding weapons in the wild, then you could use loot instead. Things like say a dragon heart is needed as part for trading for a new weapon; then the player has to go into the wild to find a dragon heart; or some system like that.
    6. Scouting Ninja

      How much equipment is too much for a group-RPG?

      This greatly depends on how easy it is to equip an item. In Avernum the player had 4 team members that could be equipped easily from the interface. Draggin a weapon from one team member to the next was easy. Equipping was also just drag and drop. When compared to Dungeon Siege 2. That required selecting the party member, going into a inventory menu, dragging and dropping from in there; it was really a pain. I always had someone on the team with weak equipment, just because i didn't want to pause gameplay. I would say 4 * (2 weapons, 3 armor, 2 accessories) is the standard. So 28 slots divided by team members? In Final Fantasy games, I was often more willing to spend a long time in menus equipping characters. However this was because you only had to do it once at every town. In the FF tactic games you had to equip after almost every battle but that was OK, because each character had only a few items. It looks like a lot of factors could be involved. Menu time, amount of times it has to be done in a play session, how smooth the interface is and just how many equip slots there is.
    7. Today
    8. CrazyCdn

      Assertion failed in pathfind (c++)?

      Eliminate the first agent. Does it still crash? Then it's data being passed in from the second agent. If it stops crashing that tells you something too. Debugging is a skill honed from experience sadly. You can read about it, but until you get first hand knowledge your learning truly does not begin . As @Alberth said, divide and conquer. Make the smallest program that still reproduces the assert.
    9. OK, but it feels pointless as Java looks a lot like C#: var Speed : float = 100f; function MoveObject(float XAxis, float YAxis){ var TempVec = new vector3(0,0,0); TempVec.x += XAxis * Speed * Time.DeltaTime; TempVec.y += YAxis * Speed * Time.DeltaTime; this.transform.position() += TempVec; } function Update(){ MoveObject(Input.GetAxis("Horizontal"),Input.GetAxis("Vertical")); } Basicly just the declaring of functions and variables change. Because most of the code is using Unity's libraries. I want to point out that Java is no longer supported by Unity. C# is Unity's main language for users now. Then you should use it, if it is what you like. Blitz3D can make good games, it is just a bit more difficult. This is true, but it means you have to compensate for it somewhere else. For example, you will notice that a lot of Blitz3D games are empty. This is because not being able to declare vectors means that basic vector math has to be done manually. So things like path finding and even just having a enemy aim at a target is more difficult in Blitz3D. Something that would just be a 4 or 5 lines of code in Godot will be a page full of code in Blitz3D, as you do everything manually step by step. So usually people just end up making their own vector class or using a wrapper for Blitz3D -like Newton Physics- to get proper vector math. This in turn needs declaration of the vector or conversion. It is still a good idea to start with Blitz3D, it is easy to learn and lots of games can be made without complex AI etc. It can also have good graphics if you use 3D models with hand painted textures.
    10. SkyPenguin

      Tile map bad performance

      so all of that's in your core graphics loop? keeping in mind that I'm not a Java programmer, avoid instantiating variables inside the loop. make the variable outside loop and then just play w/it from there. Don't make a call to canvas asking for its height in the loop. Make that a fixed variable set pre-loop. It's expensive to query canvas for its height. Things like that might not help a bunch, but should squeeze a little more fps out. If you're worried about people changing their screen size mid-game... well, most people don't, but just to make sure you can have a seperate loop that fires every.... .5 seconds? that will update canvas height/width variables. Much less taxing on system than doing that every 17 milliseconds.
    11. GoliathForge

      Fancy Ball 2 - Skins

      This could have real addiction potential. Feels juicy as shown, could use one more subtle visual layer to make it pop. (for instance, dim or blur current frame + local follow lighting) or perhaps introduce normal maps to your art pipe and render your quads with an animated light transform. Might give a 'screen sway' of sort. The other thing I'm thinking is a gental screen bump when the ball bounces to give it a little more life. Very good.
    12. That is indeed a sensible answer, but yeah I was more asking about preferances and examples that could support either way of seeing it.
    13. I think it's impossible to be sure without playtesting it, honestly. If you add more slots and it gets too cumbersome, then either it would have to be simplified again or some other element might need to be adjusted. That's probably not a great answer, but it's the only one I can think of, since I'm not sure there's an objective benchmark lol
    14. Im making a dungeon crawler/hero management game where you set out for along journey into the wilderness. The idea was that you get further and further away from civilization and the "goal" is to get to the furthest point where the last dungeon with some very tough monster awaits. You would find hamlets and outposts even far away into the wilderness. Problem is, if there is less and less civilization, how would the heroes buy better and betetr gear? No advanced blacksmith in far away in the wilderness right? The best gear can realistically be found in cities. So I have to options it seems: 1. Make gear only lootable in chests and by killing monsters (who supposably killed other heroes). But this makes gold (money) sort of useless and I dont want that. 2. Cheat. Let the heroes teleport back and forth to cities already visited to restock and buy hi end gear near the end of the journey. However this makes the survival and "venture far away" aspect of the game (which I also want) very undermined. Also it feels too much like Diablo. Any ideas? Erik
    15. lawnjelly

      Keep object in camera view

      Firstly well done for not getting wound up by my rant, major plus points, it shows considerable strength of character, most people are hugely overly sensitive to criticism. Secondly that description is far easier for us to understand. Out of interest what are the objects going to be in the area? Are they planets, and are they going to be moving? Using a reference point for the camera target sounds sensible, I'm now thinking of it as a follow cam, kind of like a third person camera. The kind of things I'd be thinking of storing to calculate my camera would be: Target position (vector3) Zoom (camera distance from target) Yaw (defined relative to target) Pitch (defined relative to target) This is all made much easier because there exists a unity function for rotating a camera to face a particular location: Quaternion.LookRotation This takes a look direction and a reference up direction. So what you need to do is Calculate the camera position Calculate the vector from the camera to the target (ptTarget - ptCamera) Use the Quaternion.LookRotation to return a quaternion which you can set as the camera rotation The most interesting bit is calculating the camera location based on the information I stored earlier. There's a few ways of doing this but here is one: You can do this by starting with a unit vector (vector of length 1) pointing out along your 'default' ground axis (where yaw = 0). This all depends how you define your map, I forget how unity does its axes, I usually use xy for ground and z is up. But essentially you can rotate your unit vector up by the pitch (there will be unity functions for rotating vectors along x, y and z), THEN rotate this result vector using the yaw. This gives you the direction to the camera. You now need to scale this vector by the distance to the camera (zoom). You can do this simply by multiplying the unit vector (it should still be length 1) by the distance to the camera. If for some reason your direction might not be length 1, you can use the Normalize function to change the length to 1 while keeping the same direction. So the camera location will be the target location PLUS this vector to the camera. Set the translate of the camera to this location, set the rotate to the quaternion given by Quaternion.LookRotation, and you are in business. There are other ways of doing things too, you can zoom by changing the field of view of the camera instead of modifying the distance. This can give a 'Hitchcock dolly zoom' effect if you modify it with distance at the same time. Note this is assuming a perspective camera. If you want to use orthographic, the distance of the camera from the target doesn't matter, just the orthographic scale you use to determine the camera matrix. Constraining the camera zoom can be done by capping the min / max distance. And constraining the target point is easy too, just do something like if (x > x_max) x = x_max; if (x < -x_max) x = -x_max; for each axis, to get a bounding box, or for a sphere: vector3 ptOffset = ptTarget - ptWorldCentre; float dist = ptOffset.Normalize(); // returns length if (dist > max_dist) { ptOffset *= max_dist; ptTarget = ptWorldCentre + ptOffset; } That's most of it, there's also determine which direction to move the target point when you track the view, but I'll leave that for the others to cover, too tired tonight!
    16. Well, you cannot have them completely seperate, there has to exist SOME connetion between the two. It's not necessary to seperate them, either (UE4, Unity, etc, don't do this either). If you really want to, you could of course create two classes, and put them as members inside a "masterclass", that manages the interop between rendering and the gamelogic. As long as you only pass the information needed for rendering to the renderer you are fine. Avoid having your renderer ASK for information, PASS it instead yourself, and tell the renderer "You know everything you need, go render it.".
    17. davejones

      Keep object in camera view

      Thank you for your detailed comment. Going forward with what you have said, I will try to clarify what it is I am trying to achieve. - I have a 3D mesh in a scene. - I want to be able to track side to side and up/down with the 3D mesh as a reference point. I also want to rotate around the 3D mesh. - The 3D mesh would be the centre point about which rotation occurs - I want to be able to zoom in/out of the mesh - I don't want to be able to infinitely track + or - in the x-axis - I don't want to be able to infinitely move + or - in the Y-axis - The maximum zoom distance from the 3D mesh has to be finite. All of these inputs are to be usable with finger (touch inputs) and also using a computer mouse. I want the inputs to be finite so that the user can't get lost at a random part of the scene. The 3D mesh is in an area and that area needs to be "caged" (bounded, blocked) from getting out of that area. This is so that the user doesn't get lost. I apologise for any confusion caused and I do hope you can understand. I'd be open to any opinions/suggestions.
    18. Steve._.Snow

      Voice Actors Needed

      hey!, you can look in these servers Voice actors: https://discord.gg/A2CGzm https://discord.gg/gXYrjS https://discord.gg/qY6r4a i hope you can find someone!.
    19. Yeah, i already expected this to happen meanwhile. The problem is we have no smooth 'tangents' at the control points, if we would compare the approach to converting a catmull rom spline to bezier spline, which is what i have in mind basically. Should be easy to fix. Lets say we have a catmull rom spline of N quats, and we are at control point i: quat cpQ[N]; for (int i=1, i<N-2, i++) { quat diff_left = rotation from cpQ[i-1] to cpQ[i+1] // 'segment' from previous to next control point (before we used from current to next) // divide angle by 6, because the 'segment' we use to calculate the 'tangent' now is twice as long quat modified_left = rotate cpQ by diff_left int j = i+1; // index for right control point quat diff_right = rotation from cpQ[j+1] to cpQ[j-1] // divide angle by 6 quat modified_right = rotate cpQ[j] by diff_right ... } I'm not really sure this works really continuously, because i miss experience with quad slerp (and i expect some wobbling because the camera view vector likely will not be aligned to the position spline tangent exactly). If it does not work well, you could look at this:
    20. Hi, for this question the knowledge of EU countries tax systems would be helpful, but your general knowledge is also welcomed. Here is a "theoretical" situation. Lets say that i made game and uploaded it to steam. I got some money from sales and now I have 2 options: should i pay taxes for Denmark(where i student) or should i pay taxes for Lithuania(where i technically still a citizen)? In general my question is: under what circumstances I should pay taxes for specific country. I mean if i got a cucumber from country "A", went to country "B" and sold it, I would give taxes for country "B" (because act of selling cucumber took place in country "B"). What about intellectual products? I mean there technically no place where i sold my product, so according to what rules my profit bounds to specific country's tax system? P.S. I doubt that place where I was while putting game into Steam is important, but just in case I will say that I putted game while I was in Lithuania(right before i went to Denmark).
    21. Just made a new song, come check it out!
    22. Thanks! I really appreciate your feedback
    23. lawnjelly

      Keep object in camera view

      Someone has to say it, and I apologise in advance as this will probably come across as overly critical, sorry I'm not very politically correct (we don't know your age / education / whether English is your first language / whether you have learning difficulties) : a lot of the confusion we are having is because a lot of your sentences don't make grammatical sense in English. I have spent a bit of time trying to work out the meaning behind them... This sentence doesn't parse in English. This also makes no sense. Camera (location?) bounds have nothing to do with pitch, roll and yaw, which are rotations. I'm guessing what you are trying to say would be this (but I can't be sure): In terms of camera yaw and pitch it is possible to move the viewpoint so that the target is no longer in view. This isn't much of an issue. My goal is to keep a certain area in view of the camera, rather than a particular target. However this seems to conflict with what you are asking here: Is the object doing the seeing, or the camera? Cameras are used to provide a viewpoint for rendering, so if anything sees, it is the camera, and not the object being viewed (unless of course you are talking about an AI object that does actually see?). This parses but it is ambiguous, you want the camera location to be bounded or the view seen from the camera? Programming in general, and the description of algorithms requires you to be very specific in your language. In natural language we get away with a certain amount of ambiguity, as the meaning can often be inferred from the context. But here when you use the word 'camera' you should specify what property of the camera you are referring to. Also another part of the problem is perhaps unfamiliarity with the terms involved in 3D. This is understandable. At a very basic level objects in 3D have a: Location Rotation (sometimes referred to as orientation) - this is often managed as either a Quaternion, Axis Angle, or Euler angles (yaw, pitch roll) A camera has a location and a rotation, and in addition extra properties such as field of view and aspect ratio. All of these interact to determine what is seen by the camera, the view. So when you refer to a camera or object, you should be specific about which properties you are referring to. If you are unsure of a term, it usually only takes a quick search on wikipedia or similar. In addition to keeping your sentences simple and specific, drawing diagrams may be useful as these are often helpful to convey ideas in 3D. Asking questions and conveying concepts about 3d graphics is not an easy thing to do, even for those who are very familiar with the subject, so please do not take this too harshly, more as practical advice. As it is, you seem to be asking how to keep an object in view of the camera, but you don't mind if the object leaves the view of the camera.
    24. Zakwayda

      Tile map bad performance

      I'm not familiar with JavaFX, but I think the first question would be, can you profile the app? It seems like that could be a good first step in analyzing the problem. You could also do some ad hoc analysis. For example, comment out just the draw calls to make sure it's specifically drawing that's causing the problem. If possible, cache the return values of getLayer*GC() instead of calling those functions repeatedly, just in case they do some non-trivial work. Try a smaller window to see if performance scales with the number of pixels drawn. And so forth. With these kinds of simple experiments you may be able to narrow things down a bit.
    25. turanszkij

      Catmull-Rom for Quaternions?

      Thanks, I tried to code up your suggestion using directxmath, here is what I came up with: XMVECTOR qA = XMQuaternionNormalize(XMLoadFloat4(&a->rotation)); XMVECTOR qB = XMQuaternionNormalize(XMLoadFloat4(&b->rotation)); XMVECTOR qC = XMQuaternionNormalize(XMLoadFloat4(&c->rotation)); XMVECTOR qD = XMQuaternionNormalize(XMLoadFloat4(&d->rotation)); XMQuaternionSquadSetup(&qB, &qC, &qD, qA, qB, qC, qD); XMVECTOR diff_ab = XMQuaternionMultiply(XMQuaternionInverse(qA), qB); // rot from a to b diff_ab = XMQuaternionNormalize(XMVectorMultiply(diff_ab, XMVectorSet(1, 1, 1, 0.33333f))); // div angle by 3 and normalize XMVECTOR modified_a = XMQuaternionNormalize(XMQuaternionMultiply(qB, diff_ab)); // rot b by diff_ab and normalize XMVECTOR diff_dc = XMQuaternionMultiply(XMQuaternionInverse(qD), qC); // rot from d to c diff_dc = XMQuaternionNormalize(XMVectorMultiply(diff_dc, XMVectorSet(1, 1, 1, 0.33333f))); // div angle by 3 and normalize XMVECTOR modified_d = XMQuaternionNormalize(XMQuaternionMultiply(qC, diff_dc)); // rot c by diff_dc and normalize XMVECTOR R = XMQuaternionSquad(qB, modified_a, modified_d, qC, t); If you can't read the code well, I can't blame you. So this kind of works, the movement is not jumping around now, and kind of smooth, but not in a nice way. When reaching the next camera location, the rotation speeds up to remain on the path and then slowly blends to the next. But the rotation is always the shortest now. I made a gif:
    26. ZekeBraiden

      Tile map bad performance

      I'm developing a 2D tile based game in JavaFx in college, I already have the sprites, animations, audio, menu ..., but I found a huge problem in rendering the map. On a 4GB notebook, Intel graphics card, Core i5, where any 2D Steam game works well at 60 FPS, my game runs from 27 to 31 FPS. I noticed that the precarious part is rendering the map, but I do not know why it's so slow. Here is the map rendering code: // Clear Layers this.getLayer1GC().clearRect(0, 0, this.getLayer1GC().getCanvas().getWidth(), this.getLayer1GC().getCanvas().getHeight()); this.getLayer2GC().clearRect(0, 0, this.getLayer2GC().getCanvas().getWidth(), this.getLayer2GC().getCanvas().getHeight()); int index = 0; int tileSize = 64 * Engine.SCALE; // 128x128 int startCol = Math.max(0, (int) (Engine.camera.xView / tileSize)); int endCol = Math.min(this.width, (int) ((Engine.camera.xView + Engine.camera.wView) / tileSize) + 1); int startRow = Math.max(0, (int) (Engine.camera.yView / tileSize)); int endRow = Math.min(this.height, (int) ((Engine.camera.yView + Engine.camera.hView) / tileSize) + 1); int tileX, tileY, indexLayer1, indexLayer2; for (int c = startCol; c < endCol; c++) { for (int r = startRow; r < endRow; r++) { // Tile Index index = this.tileManager.getTileIndex(c, r, this.width); // Tile Coordinates tileX = (int) (c * tileSize - Engine.camera.xView); tileY = (int) (r * tileSize - Engine.camera.yView); // Cache Tileset Images indexLayer1 = this.layer1.tileArray[index]; indexLayer2 = this.layer2.tileArray[index]; // Layer 1 if (indexLayer1 > 0) { this.getLayer1GC().drawImage(this.mapTilset.tileImages[indexLayer1], 0, 0, tileSize, tileSize, tileX, tileY, tileSize, tileSize); } // Layer 2 if (indexLayer2 > 0) { this.getLayer2GC().drawImage(this.mapTilset.tileImages[indexLayer2], 0, 0, tileSize, tileSize, tileX, tileY, tileSize, tileSize); } } }
  • Advertisement

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!