• Advertisement

All Activity

This stream auto-updates     

  1. Past hour
  2. Today
  3. GUNNSWITCH

    The development of the visuals for the caves in GunnSwitch are at 95% completion! We are very curious, as most love hungry indie devs, do you all out there like the look and theme? Your criticism and suggestions are valued! Cheers!
  4. Help With Story-Driven Game Concept

    I think you have a pretty strong theme to work with and overall storyline. I think in terms of figuring out the nuances and story beats, motifs, etc. you can do that by starting to write a script - start at a point that draws your interest, write the scene and how it plays out. A game isn't going to be as linear as a script, but you can kinda figure out things like main story beats, get an idea of the pacing, and how the "side-quests" or the more freeform activity the player does will fit into the themes, etc. As for gameplay I think it's a good idea to think about what best helps reinforce the games themes and motifs, e.g. a point and click can feel more deliberate and contemplative, parhaps fitting into themes of mystery and problem-solving, RPGs are generally about characters, personal identity, empowerment, etc. Of course you can invent a new kind of gameplay. I'd also think in terms of what you would find enjoyable to play.
  5. It's nice to see that people still can't read on the internet, let me just do the legwork for you, here is a quote from the reddit admin's response to my message about the shadowban (a post just 2 screens above yours):
  6. If you have worked on somebody else’s project, you know how hard it is to makes sense of long blocks of complicated codes not written by you. There were many reasons Apple introduced Swift Programming Language in 2014 to replace Objective-C, Apple’s primary programming language since 1996. The main reason was getting a piece of work done without the programmer having to write long lines of codes and raise readability of the program written. For example, Swift, unlike Objective C, supports functional programming, doesn’t need instance variables and to state the type explicitly, and has the ability to map raw value to enum directly. Swift is, indeed, the iOS development language for lazy developers. Of course, Swift supports the traditional programming paradigms based on the rules of mathematics like any other languages. Sometimes, developers have no option but to use them. However, most of the time, Swift programmers can do away with fewer lines of code. I will validate my point with a few code examples: 1. Swift extensions are a life saver Long, boring codes make an already tough job of a programmer, tougher. For example, writing a program to square a number makes Swift look such an average programming language, it is not in the code example below. func square(x: Int) -> Int { return x * x } var squaredOFFive = square(x: 5) square(x:squaredOFFive) // 625 As I said, Swift makes way for smaller, concise code. In this example, the credit goes to Swift extensions. Squaring a number seems like a cakewalk. extension Int { var squared: Int { return self * self } } 5.squared // 25 5.squared.squared // 625 Did you know unlike Objective-C categories, Swift extensions do not have name? 2. Use Generics and avoid creating unnecessary functions Three functions and three variables are an overblow to write such a minuscule program. Swift doesn’t seem to add any value to the programmer in the following code example. var stringArray = ["Bob", "Bobby", "SangJoon"] var intArray = [1, 3, 4, 5, 6] var doubleArray = [1.0, 2.0, 3.0] func printStringArray(a: [String]) { for s in a { print(s) } } func printIntArray(a: [Int]) { for i in a { print(i) } } func printDoubleArray(a: [Double]) {for d in a { print(d) } } With generics, you can write the above example with a single function in Swift. func printElementFromArray<T>(a: [T]) { for element in a { print(element) } } 3. Use For loop when you want to use While loop While loops are unnecessarily long to write. A single loop to count numbers from 1 to 5 doesn’t have to be 4 lines long. var i = 0 while 5 > i { print("Count") i += 1 } For loops are a complete bliss in Swift. The example below will clear you doubts if you had any. for _ in 1...5 { print("Count") } 4. Use Guard let, not if let If let leads to hideous codes. A pyramid of doom is a big no-no in programming, at least with Swift as the language to develop iOS apps. Look at the code example to welcome new users. Those are nasty nested code. var myUsername: Double? var myPassword: Double? func userLogIn() { if let username = myUsername { if let password = myPassword { print("Welcome, \(username)"!) } } } Abolish the bad, bring the good with Guard let var myUsername: Double? var myPassword: Double? func userLogIn() { guard let username = myUsername, let password = myPassword else { return } print("Welcome, \(username)!") } 5. Exclusive functions vs dependent function You can create two mutually exclusive functions or you can connect between them if you’re looking to write smaller codes. The following code example finds the diameter of a circle using two exclusive functions. func getDiameter(radius: Double) -> Double { return radius * 2} func getRadius(diameter: Double) -> Double { return diameter / 2} getDiameter(radius: 10) // return 20 getRadius(diameter: 200) // return 100 getRadius(diameter: 600) // return 300 However, when the radius and diameter variables dependent on each other, you will make more connections, type less, make fewer typos, result in fewer bugs and thus rarer instances of programming blunders. var radius: Double = 10 var diameter: Double { get { return radius * 2} set { radius = newValue / 2} } radius // 10 diameter // 20 diameter = 1000 radius // 500 6. Enum to Type Safe “Adult”, “Child”, “Senior”. You are not supposed to do hard coding in Swift. The least, there mustn’t arise an event when you have type all these string values for each case, over and again. That’s a big no. Don’t do that, please. switch person { case "Adult": print("Pay $7") case "Child": print("Pay $3") case "Senior": print("Pay $4") default: print("You alive, bruh?") } When you write too much, you lose track and end up making mistakes. Did I mention, Swift has the ability to map raw value to enum directly. Let’s leverage on it. enum People { case adult, child, senior } var person = People.adult switch person { case .adult: print("Pay $7") case .child: print("Pay $3") case .senior: print("Pay $4") } You will never make a typographical error because “.adult”, “.child”, “.senior” will highlight themselves in the Apple’s IDE. 7. If let is hard to get by If let is something you’re going to encounter in every language. The advantage with Swift is you can skip it more often than other programming languages. For example, the code below helps users choose Twitter theme color. var userChosenColor: String? var defaultColor = "Red" var colorToUse = "" if let Color = userChosenColor { colorToUse = Color } else { colorToUse = defaultColor } I can cut the code. This is going to change your life as a programmer. var colorToUse = userChosenColor ?? defaultColor If userChosenColor returns nil, choose defaultColor (red). If not, choose userChosenColor. As simple as that. 8. Conditional Coalescing Hair spike increases your height by a couple of inches. So I tried to write a code to solve the problem, except against Swift convention I used three variable and if else in my code. Will god forgive me? var currentHeight = 185 var hasSpikyHair = true var finalHeight = 0 if hasSpikyHair { finalHeight = currentHeight + 5} else { finalHeight = currentHeight } I am a god-fearing programmer and have utmost respect for the Apple’s primary programming language. So I compacted the code above my measures. This is how it looks now. finalHeight = currentHeight + (hasSpikyHair ? 5: 0) The code above states, if hasSpikeHair is true, add 5 to the final height, if not add zero. May the force be with you. The power of Functional Programming Among many reasons Apple replaced Objective C with Swift as its primary programming languge, one was Objective C’s alienation with functional programming. I have written the program below in Swift as I would have in Objective C that lacks functional programming. The code looks lousy, doesn’t it? var newEvens = [Int]() for i in 1...10 { if i % 2 == 0 { newEvens.append(i) } } print(newEvens) // [2, 4, 6, 8, 10] A simple function will get me rid of the For loop and if let (I hate it) and will reduce the entire code to two lines. Just take a look back and see how much time you wasted writing for-loop. Let’s make the code explicit. Ingenious, isn’t it? var evens = Array(1...10).filter { $0 % 2 == 0 } print(evens) // [2, 4, 6, 8, 10] Functional Programming is prodigious. Functional Programming separates shrewd programmers from everyday programmers. Closure vs Func This is how a normal function looks like in in Swift. I mean this looks a fine piece of code. func sum(x: Int, y: Int) -> Int { return x + y } var result = sum(x: 5, y: 6) // 11 However, who wants to remember the name of the function and the variable when you can do away with remembering either a function or variable. I chose variable in this case: var sumUsingClosure: (Int, Int) -> (Int) = { $0 + $1 } sumUsingClosure(5, 6) // 11 Love your code and it is gonna love you back
  7. Measuring acceleration in units/s is weird, unless "unit" is a unit of velocity: Something like m/s^2 would make more sense. Max speed 15 means absolutely nothing; it should be in units like m/s. Turn speed can't possibly have the same units as acceleration; it should be something like degrees/s^2, or simply 1/s^2 (which means radians/s^2). There is a field called Control Theory and a class of algorithms called Dynamic Programming that deal precisely with problems like yours, but I only know a little bit about them, and it's pretty heavy stuff. My practical advice is to turn your problem into a path-finding problem. Are you familiar with any path-finding algorithms? A* is probably the best, but not the easiest thing to get right if you are new at this. Anyway, if you discretize your states (i.e., divide time into steps, restrict the position of your vehicle to a grid and express velocity as two integers), you can think of all the possible states as a big graph. Your map and max speed will determine what states are possible. Your restrictions on acceleration and turning speed will determine connectivity between nodes. So set a goal state and velocity and run something like A* to figure out how to get there. The discretization step requires judicious choices of time step and grid resolution: Finer is closer to the original problem, but the CPU time it takes to run the algorithm will quickly get prohibitive. I understand even this solution might not be easy to implement, but you came here with a difficult problem.
  8. So, you regularly post spam in forums until you are banned? How about not posting "improperly" in the first place? THAT would be fair and useful behaviour on your side. There are a lot of things wrong with reddit, and I can understand that this ban made you feel like an idiot. On the other hand, if you regularly post stuff in forums that makes mods ban your posts, it's only fair that you should feel like an idiot for some time.
  9. For example we want to the user to be able to lerp between male and female by a slider, you can do this by modeling both from the same topology. Assume we already have a male base model. Move all vertices so it looks female, but don't add or remove vertices. For each vertex store the difference to the original male position. (we call this a relative 'morph shape', or 'blend shape'). In the game the character then is made by male_vertex + female_offset * gender_slider. You can also handle details this way, e.g. make just the nose large (so most vertex differences are zero). You can combine all options simply by: male_vertex + female_offset * gender_slider + nose_offset * nose slider... The second option to consider is to affect skeleton bones, e.g. Male: wide shoulders, narrow pelvis, Female: narrow shoulders, wide pelvis. You can utilize scale and sheer as well for skinny / fat and so forth. But with caution, as altering skeletons also affects its animations.
  10. ID3D11Device and ID3D11DeviceContext

    Can someone close and remove this topic? It seems that I somehow created two identical topics. goto:
  11. How do game engine architectures (not in the game code) organize their different subsystems? Currently, I use a "hybrid" of the Singleton and Service Locator design pattern. Engine InputManager ... RenderingManager RenderingStateManager (encapsulates common blend, depth-stencil, rasterizer and sampler states) RenderingOutputManager (encapsulates the main output resources and their views) Renderer (encapsulates the rendering passes) SwapChain (could be a manager of SwapChains as well in case of multiple windows) My Engine class can only be instantiated once. Upon instantiation, it constructs all managers responsible for the different subsystems (input, rendering, resources, etc.). These managers can be accessed by invoking getters on the Engine object. To facilitate accessing the managers further, I add a class method to each manager class which internally will invoke the corresponding getter on the singleton Engine object. That way, I can just write code as RenderingManager::Get()->GetDisplayConfiguration() for example, and I do not need to include the engine header every time. Unfortunately, this seems a bit dual: you can create as many managers as you want (not that I create more than one), but there is one manager that has a privileged way of accessing it. Furthermore, I am not really happy with this approach since you eventually always fall back to the engine itself by including the engine header inside the managers' .cpp files. So I rather want to decouple the first-layer of managers completely from the engine itself into a separate static library each and make each manager a singleton (just like I did with the engine). The benefit of making these managers singletons is not having to pass pointers around (note that it will never be the case that you have to pass m pointers n levels deep). It allows me to just create zero-argument factory functions such as CreateWhiteTexture(). On the one hand less there is less boiler plate code. On the other hand this makes it harder to spot dependencies or know whether a function is pure. Any thoughts and suggestions on how it is commonly done?
  12. Thanks for the insights. Glad(sad?) to see that there's quite some complexity involved for a foolproof async asset loading system.
  13. Is it common to have more than one ID3D11Device and/or associated immediate ID3D11DeviceContext? If I am correct a single display subsystem (GPU, video memory, etc.) is completely determined (from a 3D rendering perspective) by a IDXGIAdapter (meta functionality facade); ID3D11Device (resource creation facade); ID3D11DeviceContext (pipeline facade). So given that you want to use multiple display subsystems, you will have to handle multiple of these interfaces. A concrete example would be a graphics card dedicated to rendering and a separate graphics card dedicated to computation, or combining an integrated and dedicated graphics card. All such cases seem to me quite far fetched to justify support in a majority of games. So moving one abstraction level further downstream, should a game engine even consider multiple display systems (i.e. there is just one ID3D11Device and one immediate ID3D11DeviceContext)?
  14. Is it common to have more than one ID3D11Device and/or associated immediate ID3D11DeviceContext? If I am correct a single display subsystem (GPU, video memory, etc.) is completely determined (from a 3D rendering perspective) by a IDXGIAdapter (meta functionality facade); ID3D11Device (resource creation facade); ID3D11DeviceContext (pipeline facade). So given that you want to use multiple display subsystems, you will have to handle multiple of these interfaces. A concrete example would be a graphics card dedicated to rendering and a separate graphics card dedicated to computation, or combining an integrated and dedicated graphics card. All such cases seem to me quite far fetched to be just supported at all by the majority of games. So moving one abstraction level further downstream, should a game engine even consider multiple display systems (i.e. there is just one ID3D11Device and one immediate ID3D11DeviceContext)?
  15. Thank you very much Scouting Ninja! Great solution, I did't think about that I also thought about doing it with vectors, but I didn't know how, so this was the best I could come up with Again, thanks for a quick and elaborate reply. @swiftcoder Makes sense! I won't do it again
  16. DX11 WARP vs UAVs in PS

    Over the years and platforms this is far from the only bug that makes me wanna cry My UAV start slot is 1 (u1) indeed, but I do not have a missmatch there. As I said, it works fine with normal drivers and it works fine now with setting a dummy (big enough) RTV with WARP.
  17. Wondering how it works. Let's say Saints Row 3,4 Skyrim 5 Falout 4 These games can customize player face and body,how it works and is there any tutorial guide you to do a simple body modelling system by yourself? I mean how to write code to achieve modelling in game,not modding for these games.
  18. hello, I am trying to implement a realistic simulation of a roulette wheel. it is not clear for me what is the proper way to simulate the initial status of the ball, when it spins against the edge of the wheel until it loss energy and start falling towards the centre. I modelled the conic table as a height map, as I assume that would provide the smoother surface. but I see anyway there is rough squared corners everywhere, so really I don't have a smooth inner wall to slide against. I wonder if I should ignore the wall and simulate the sliding by code. i.e: apply force (or impulse?) each frame to keep the ball at a fixed radius and somehow force it to follow a desired angular speed.. later, when I want to execute the falling behaviour, just stop applying that forces and let the simulator and the gravity do their work.. makes sense? any advice is highly appreciated!
  19. Thank you, this is some great affirmation on my shaky logic. Your talk was what actually really inspired me to try my hand at this being the most approachable for a threading newbie. I think one of my misconceptions was about how I would be blocking the rendering thread when doing any allocation. Going to finish up my simple spec and tackle this over the weekend.
  20. OpenGL Shader class instancing question

    For each effect you use one shader, Say you draw 1000 particles with the same effect you use one shader only for that, it can be like some type of global variable defined somewhere so you can refer to it, or in this case you could use a pointer to gluint (shader)
  21. Forget it, i introduced a callback to prepare a window for graphics api initialization, like SetPixelFormat() on Win32 or glxChooseVisual() on GLX/POSIX. This callback is called before the actual window is being created.
  22. I splittetd my whole asset loading up for less memory and time consumption by general. My asset systems usually have two functions that are namespace XX { bool LoadHeader(IDataReader& stream, XXHeader& header); bool Load(IDataReader& stream, XXHeader const& header, <whatever XX's buffer is>& data); } so that you have to grab the meta data (typically a header) before you can load the data. I'm using this in order of a memory mapped buffer that is bound to a package on hard drive, consisting of several chunks of that package so loading (that is task based in my case and could be on one or more threads in parallel) performs on this as though it is reading a simple byte array capable to work at max performance. When requesting a resource you only have to pay the lookup into memory and meta data processing first a resource was requested. The system will thenr eturn a resource handle who's data is loaded in background while the requesting thread is able to run ahead with that. If data is necessearry but not loaded, it will be passed in this round
  23. Wow, I've just realized who wrote this post. It's an honor to have you here, Sir. I more than agree than notifications are much more user friendly than shadowbans. Being a terrible person :), I had experienced how GameDev's system works myself and I can say that it is more than friendly and fair. At the same time I can see shadowbans being effective, but like I said, it needs to be controlled: if all the messages that are shadowbanned actually enter a queue and are read by a human at some point, so that a human can cherry pick which messages to show and which to keep hidden and maybe even decide to unban a person once their comment start to be proper, THAT would a fair and useful system. What I encountered was a broken piece of code.
  24. @Mike2343At first, It gives nothing. When I change values for a and b, then it gives an error.
  25. Hodgman's code has nothing to do with std::map, it's a test to show you why it's likely not working. Copy and paste his code into a function in your project and call it before anything else and see the results of the ASSERT function...
  26. I Need An Older Open World Engine

    Hey, I'm not attempting to bump an older thread but need to revive this for the same reason. I am now at home with my gaming computer specs below AMD A8-7600 Radeon R7 (4 CPUS) 3.1GHZ 8gb Ram 1TB hard drive AMD R7 Graphics Not the best for gaming pc but good enough I need to do some upgrading but regardless it can handle most/all engines so specs are not a worry. I was coding with unreal engine 4 but came into some problems so decided to start creating an offline mmo idea which was working until a few problems mainly with the community being super small. But am now looking for anybody willing to give advice for creating an elder scrolls style open world (Not just 3 and 4 but 3, 4 and 5 and some other like games) I have experience in c++ I am 2 years into java and still understand game maker studio coding completely.
  27. DX11 Loading FBX with Directx 11

    @galop1n I managed to write std::map code. But my std::map code doesn't work. it doesn't generate duplicate vertices. For example, when I load Plane.fbx, it gives me the vertex array of -5 -5 0 5 -5 0 -5 5 0 5 5 0 0 0 0 0 0 0 the index array is simply, 0, 1, 2, 3, 4, 5 not 0, 1, 2, 2, 1, 3 Can you help me? bool operator < ( const FBXVTX &lValue, const FBXVTX &rValue) { if (lValue.Position.x != rValue.Position.x) return(lValue.Position.x < rValue.Position.x); if (lValue.Position.y != rValue.Position.y) return(lValue.Position.y < rValue.Position.y); if (lValue.Position.z != rValue.Position.z) return(lValue.Position.z < rValue.Position.z); if (lValue.TextureCoord.x != rValue.TextureCoord.x) return(lValue.TextureCoord.x < rValue.TextureCoord.x); if (lValue.TextureCoord.y != rValue.TextureCoord.y) return(lValue.TextureCoord.y < rValue.TextureCoord.y); if (lValue.Normal.x != rValue.Normal.x) return(lValue.Normal.x < rValue.Normal.x); if (lValue.Normal.y != rValue.Normal.y) return(lValue.Normal.y < rValue.Normal.y); return(lValue.Normal.z < rValue.Normal.z); } struct FBXVTX { XMFLOAT3 Position; XMFLOAT2 TextureCoord; XMFLOAT3 Normal; }; std::map< FBXVTX, int > myVertsMap; std::vector<FBXVTX> myVerts; std::vector<int> myInds; HRESULT FBXLoader::Open(HWND hWnd, char* Filename, bool UsePositionOnly) { HRESULT hr = S_OK; if (FBXM) { FBXIOS = FbxIOSettings::Create(FBXM, IOSROOT); FBXM->SetIOSettings(FBXIOS); FBXI = FbxImporter::Create(FBXM, ""); if (!(FBXI->Initialize(Filename, -1, FBXIOS))) { hr = E_FAIL; MessageBox(hWnd, (wchar_t*)FBXI->GetStatus().GetErrorString(), TEXT("ALM"), MB_OK); } FBXS = FbxScene::Create(FBXM, "REALMS"); if (!FBXS) { hr = E_FAIL; MessageBox(hWnd, TEXT("Failed to create the scene"), TEXT("ALM"), MB_OK); } if (!(FBXI->Import(FBXS))) { hr = E_FAIL; MessageBox(hWnd, TEXT("Failed to import fbx file content into the scene"), TEXT("ALM"), MB_OK); } FbxAxisSystem OurAxisSystem = FbxAxisSystem::DirectX; FbxAxisSystem SceneAxisSystem = FBXS->GetGlobalSettings().GetAxisSystem(); if(SceneAxisSystem != OurAxisSystem) { FbxAxisSystem::DirectX.ConvertScene(FBXS); } FbxSystemUnit SceneSystemUnit = FBXS->GetGlobalSettings().GetSystemUnit(); if( SceneSystemUnit.GetScaleFactor() != 1.0 ) { FbxSystemUnit::cm.ConvertScene( FBXS ); } if (FBXI) FBXI->Destroy(); FbxNode* MainNode = FBXS->GetRootNode(); int NumKids = MainNode->GetChildCount(); FbxNode* ChildNode = NULL; for (int i=0; i<NumKids; i++) { ChildNode = MainNode->GetChild(i); FbxNodeAttribute* NodeAttribute = ChildNode->GetNodeAttribute(); if (NodeAttribute->GetAttributeType() == FbxNodeAttribute::eMesh) { FbxMesh* Mesh = ChildNode->GetMesh(); if (UsePositionOnly) { NumVertices = Mesh->GetControlPointsCount();//number of vertices MyV = new XMFLOAT3[NumVertices]; for (DWORD j = 0; j < NumVertices; j++) { FbxVector4 Vertex = Mesh->GetControlPointAt(j);//Gets the control point at the specified index. MyV[j] = XMFLOAT3((float)Vertex.mData[0], (float)Vertex.mData[1], (float)Vertex.mData[2]); } NumIndices = Mesh->GetPolygonVertexCount();//number of indices MyI = (DWORD*)Mesh->GetPolygonVertices();//index array } else { FbxLayerElementArrayTemplate<FbxVector2>* uvVertices = NULL; Mesh->GetTextureUV(&uvVertices); int idx = 0; for (int i = 0; i < Mesh->GetPolygonCount(); i++)//polygon(=mostly triangle) count { for (int j = 0; j < Mesh->GetPolygonSize(i); j++)//retrieves number of vertices in a polygon { FBXVTX myVert; int p_index = 3*i+j; int t_index = Mesh->GetTextureUVIndex(i, j); FbxVector4 Vertex = Mesh->GetControlPointAt(p_index);//Gets the control point at the specified index. myVert.Position = XMFLOAT3((float)Vertex.mData[0], (float)Vertex.mData[1], (float)Vertex.mData[2]); FbxVector4 Normal; Mesh->GetPolygonVertexNormal(i, j, Normal); myVert.Normal = XMFLOAT3((float)Normal.mData[0], (float)Normal.mData[1], (float)Normal.mData[2]); FbxVector2 uv = uvVertices->GetAt(t_index); myVert.TextureCoord = XMFLOAT2((float)uv.mData[0], (float)uv.mData[1]); if ( myVertsMap.find( myVert ) != myVertsMap.end() ) myInds.push_back( myVertsMap[ myVert ]); else { myVertsMap.insert( std::pair<FBXVTX, int> (myVert, idx ) ); myVerts.push_back(myVert); myInds.push_back(idx); idx++; } } } } } } } else { hr = E_FAIL; MessageBox(hWnd, TEXT("Failed to create the FBX Manager"), TEXT("ALM"), MB_OK); } return hr; }
  1. Load more activity
  • Advertisement