• What Do You Need Help With? V6
    7,544 replies, posted
Guys, I'm about to rasp baby hamsters. I don't know what to do, please help me. I'm using LibGDX and I'm calling this function: mesh = new Mesh(VertexDataType.VertexArray, true, 2 * res, 50, new VertexAttribute(Usage.Position, 2, "a_position")); Which is throwing me this error: Exception in thread "main" java.lang.UnsatisfiedLinkError: com.badlogic.gdx.utils.BufferUtils.newDisposableByteBuffer(I)Ljava/nio/ByteBuffer; at com.badlogic.gdx.utils.BufferUtils.newDisposableByteBuffer(Native Method) at com.badlogic.gdx.utils.BufferUtils.newUnsafeByteBuffer(BufferUtils.java:288) at com.badlogic.gdx.graphics.glutils.VertexArray.<init>(VertexArray.java:62) at com.badlogic.gdx.graphics.glutils.VertexArray.<init>(VertexArray.java:53) at com.badlogic.gdx.graphics.Mesh.<init>(Mesh.java:148) at com.TryScape.Terrain.<init>(Terrain.java:23) at com.TryScape.TryScape.<init>(TryScape.java:19) at com.TryScape.Main.main(Main.java:15) I have checked the linked gdx library and the file it has problems with is there and it's linked. However in eclips the class "unsafebytebuffer" has a red square with an N.S on top of it. Is this a problem?
Still having issues with specular lighting, although I tried to get some help from stack overflow. This is the code as it stands: [url]http://pastebin.com/hfQPheuB[/url] The issue I am having is the lack of specular lighting, and this effect appearing, a spotlight from origin to the location of the light, pictured here [url]http://i.imgur.com/BBoArEv.png[/url]
[QUOTE=The Sparrow;41443948]Guys, I'm about to rasp baby hamsters. I don't know what to do, please help me. I'm using LibGDX and I'm calling this function: mesh = new Mesh(VertexDataType.VertexArray, true, 2 * res, 50, new VertexAttribute(Usage.Position, 2, "a_position")); Which is throwing me this error: Exception in thread "main" java.lang.UnsatisfiedLinkError: com.badlogic.gdx.utils.BufferUtils.newDisposableByteBuffer(I)Ljava/nio/ByteBuffer; at com.badlogic.gdx.utils.BufferUtils.newDisposableByteBuffer(Native Method) at com.badlogic.gdx.utils.BufferUtils.newUnsafeByteBuffer(BufferUtils.java:288) at com.badlogic.gdx.graphics.glutils.VertexArray.<init>(VertexArray.java:62) at com.badlogic.gdx.graphics.glutils.VertexArray.<init>(VertexArray.java:53) at com.badlogic.gdx.graphics.Mesh.<init>(Mesh.java:148) at com.TryScape.Terrain.<init>(Terrain.java:23) at com.TryScape.TryScape.<init>(TryScape.java:19) at com.TryScape.Main.main(Main.java:15) I have checked the linked gdx library and the file it has problems with is there and it's linked. However in eclips the class "unsafebytebuffer" has a red square with an N.S on top of it. Is this a problem?[/QUOTE] Did you use the Libgdx Setup tool?
[QUOTE=ZeekyHBomb;41444279]Did you use the Libgdx Setup tool?[/QUOTE] Yes. Might it be a problem with the nio library? I don't know what to do in that case
That's just the mangled name for the native method newDisposableByteBuffer, the java.nio.ByteBuffer is the return type. I don't have any experience working with Libgdx, I just picked up the name of the tool form the documentation. You should try their forum, IRC channel or bugtracker.
i need help finding these errors its really frustrating. [QUOTE] C:\Users\*********\Desktop\c++ projects\user_input\main.cpp|28|error: expected primary-expression before 'or' token| C:\Users\*********\Desktop\c++ projects\user_input\main.cpp|29|error: expected ';' before '{' token| C:\Users\*********\Desktop\c++ projects\user_input\main.cpp|46|error: 'else' without a previous 'if'| C:\Users\*********\Desktop\c++ projects\user_input\main.cpp|53|error: 'else' without a previous 'if'| ||=== Build finished: 4 errors, 0 warnings (0 minutes, 1 seconds) ===| [/QUOTE] heres the code [code]#include <iostream> using namespace std; int main() { string word; string SZword; string difficulty; string easy; string medium; string hard; int diffloop; diffloop = false; int loop; loop = 3; SZword = "balls"; cout << "select difficulty (easy, medium, hard)"; cin >> difficulty; if(difficulty == "easy") loop = 3; else if(difficulty == "medium") loop = 2; else if(difficulty == "hard") loop = 1; else if(diffloop == false) while (diffloop == false) if (difficulty == "easy") or (difficulty == "medium") or (difficulty == "hard") { diffloop = true; } else cout << "please enter easy, medium, or hard"; cin >> difficulty; cout << " You guessed the secret word!\n"; loop = -1; while (loop > 0) { cout << "guess the secret word\n" << endl; cin >> word; } if(word == SZword) cout << " You guessed the secret word!\n"; loop = -1; else loop = loop - 1; cout << " You didn't guess the secret word!\n"; cout << " attempts left: " << loop << "\n"; if (loop == 0) cout << "SYSTEM LOCKED\n"; cout << "authorities notified\n"; else return 0; } [/code]
[cpp]if (difficulty == "easy") or (difficulty == "medium") or (difficulty == "hard")[/cpp] You're missing another set of parenthesis [cpp]if ((difficulty == "easy") or (difficulty == "medium") or (difficulty == "hard"))[/cpp] (although the inner ones would not be neccesary due to operator precedence. It does look pretty strange all over. In no particular order: Some indentation is weird. I think you're missing curly braces - C++ does not do scoping by indentation. loop will always be -1, no matter what you enter. What do you need the strings easy, medium and hard for? Why is diffloop and int, not a bool? It is considered good style if you declare variable as late as possible (but still as soon as necessary) instead of sticking them all to the beginning. SZword is the only variable beginning with uppercase letters. You can write if(!something) instead of if(something == false), but I guess personal preference. You can initialize stuff when declaring (string SZword = "balls";).
Derp
I haven't had a computer in a while... And I was always interested in programming and never got around to it. I'm 18 and i really want to make this happen, I have reminders everywhere to stay on track. Question is, where do I begin learning? What should I start with? I want to get to the point where I can program my own 3d game that's sort of like older fps's but with modern graphics.. Idk if I'm being too vague but I really want to make this happen no matter what it takes, I just dont know where or how to start..
[QUOTE=WTF Nuke;41444218]Still having issues with specular lighting, although I tried to get some help from stack overflow. This is the code as it stands: [url]http://pastebin.com/hfQPheuB[/url] The issue I am having is the lack of specular lighting, and this effect appearing, a spotlight from origin to the location of the light, pictured here [url]http://i.imgur.com/BBoArEv.png[/url][/QUOTE] When transforming your normals into cam space you need to multiply by the model matrix [b]and[/b] the view matrix. You also need to make sure that you only multiply by the top left 3x3 part of the matrix to prevent translation of the normals: [code]NormalCamSpace = (M*vec4(normal,0.0)).xyz;[/code] should be [code]NormalCamSpace = mat3(V)*mat3(M)*normal;[/code]
[QUOTE=MakeR;41451769]When transforming your normals into cam space you need to multiply by the model matrix [b]and[/b] the view matrix. [b]You also need to make sure that you only multiply by the top left 3x3 part of the matrix to prevent translation of the normals[/b]: [code]NormalCamSpace = (M*vec4(normal,0.0)).xyz;[/code] should be [code]NormalCamSpace = mat3(V)*mat3(M)*normal;[/code][/QUOTE] The w-component being 0 takes care of that.
[QUOTE=thf;41452933]The w-component being 0 takes care of that.[/QUOTE] Ah, I missed that.
Argh, yes I had it like that before, but I did as some stack overflow answer told me to. That's why the variable name is cam space not world space. [editline]14th July 2013[/editline] Still, same issue. I'm a fucking moron. The issue was that I was passing the model matrix as the view and the model matrix. I am going to go cry now.
If I want to start using graphics and stuff with C#, what should I use, where do I get it and how do I do it (tutorials)? Also, I have been using Microsoft Visual C# 2010 Express while learning, should I change that? Thanks in advance
[QUOTE=JohanGS;41459696]If I want to start using graphics and stuff with C#, what should I use, where do I get it and how do I do it (tutorials)? Also, I have been using Microsoft Visual C# 2010 Express while learning, should I change that? Thanks in advance[/QUOTE] I like [url=https://github.com/mono/MonoGame]MonoGame[/url] myself. It's basically the same as XNA, but works on all modern platforms. Visual C# Express 2010 should work fine.
I might need to write a small daemon to control sprinklers. It will have one data file where it reads the configuration for the sprinklers (how many, when to start sprinkling, for how long, etc.) but the details of this are trivial. I'm new to writing daemons though and need some advice, here is what I'm thinking thus far (pseudocode, I plan to write in C): [CODE]fork() and write pid to file parse data file into memory while true { operate based upon data in memory sleep some }[/CODE] This will work, but I also want to be able to change the configuration from another process, probably just a simple script. The problem is that if I just poll the config file I waste a lot of IO, and if I wait a reasonable time between polls I won't be able to change the daemon state immediately, only when the daemon polls the file again. The first fix I thought of was signals, but it sounds like the thread can be interrupted at any time, so you have to keep memory access atomic, is this the case? If so, is it safe to intercept a signal and then in the handler re-parse the configuration file and repopulate the memory structure for the program? If not how would you handle this? I was thinking about using timers and more handler functions instead of a big main loop, but I think a timer handler can be interrupted by a signal just the same way any other process code can. Also if there is some better way I've overlooked to immediately (or almost immediately) instruct a daemon to re-parse its config file in a safe manner I would be really grateful.
[QUOTE=Rayjingstorm;41462343]Also if there is some better way I've overlooked to immediately (or almost immediately) instruct a daemon to re-parse its config file in a safe manner I would be really grateful.[/QUOTE] Check the file date for changes.
[QUOTE=Tamschi;41463554]Check the file date for changes.[/QUOTE] Alright, I was probably overthinking it. Thanks.
Nevermine, figured it out.
Okay so I was asked to make a plugin in C# to attach the w3wp.exe process automatically. It's my first time making a plugin and I need some help. I'm getting a list of the processes using the GetProcesses method, and then searching for the w3wp.exe processes and then selecting only the one with the label containing "Administrator". My problem is how to actually attach the process. It needs to do the same thing that going to Tools/Attach to process and then selecting the process does. Not sure how I can attach it this way though. Any help?
You should be able to do that via [url=http://msdn.microsoft.com/en-us/library/vstudio/envdte._dte.executecommand.aspx]EnvDTE.DTE.ExecuteCommand[/url].
[QUOTE=ZeekyHBomb;41468412]You should be able to do that via [url=http://msdn.microsoft.com/en-us/library/vstudio/envdte._dte.executecommand.aspx]EnvDTE.DTE.ExecuteCommand[/url].[/QUOTE] Could you give me an example? I don't really know how I would implement it. Right now I have the processes ID that I want to attach, so can I do that using that ExecuteCommand? Or do I need to find the process some other way? Thanks!
I'm not great with data structures or serialisation, so treat me as a novice. I'm trying to store a two-dimensional array of ints or chars in XML for reading and writing in Java. The file will be used to construct an array of cells to form a ship in my game, like this: [img]http://i.imgur.com/EmmzlEZ.jpg[/img] The idea is that the array will look like this: [code] [1,1,0,0,0,0,0,0,0,0,0,0,0], [1,1,1,1,1,1,1,1,1,1,1,1,1], [1,1,0,0,0,1,0,0,1,1,0,0,0] [/code] with 1's being cells and 0's being spaces not occupied by a cell. I'm not good at XML. How would I go about doing this?
Just for reference Zeeky, here's a paste bin of the code I'm using the get the process. Maybe you can tell me if I have to change it around or not cause I'm really stumped with this
Anyone has experience with cell processor/ps3 programming? I'm trying to make a real-time model extractor like dxripper, but I fail constantly, I was only able to extract textures.
[QUOTE=Over-Run;41468622]Just for reference Zeeky, here's a paste bin of the code I'm using the get the process. Maybe you can tell me if I have to change it around or not cause I'm really stumped with this[/QUOTE] There's no pastebin link there :v: Anyway, I don't have any experience with plugin development myself, but the documentation seems to suggest, that you can just call ExecuteCommand("Tools.Attach to process", pid.toString()); or something like that. I have a rough idea what it should look like though, so I might be able to point you in the right direction, assuming my hunch is correct. Assuming you are writing a Visual Studio Add-in... [QUOTE=Nigey Nige;41468610]I'm not great with data structures or serialisation, so treat me as a novice. I'm trying to store a two-dimensional array of ints or chars in XML for reading and writing in Java. The file will be used to construct an array of cells to form a ship in my game, like this: [img]http://i.imgur.com/EmmzlEZ.jpg[/img] The idea is that the array will look like this: [code] [1,1,0,0,0,0,0,0,0,0,0,0,0], [1,1,1,1,1,1,1,1,1,1,1,1,1], [1,1,0,0,0,1,0,0,1,1,0,0,0] [/code] with 1's being cells and 0's being spaces not occupied by a cell. I'm not good at XML. How would I go about doing this?[/QUOTE] Why XML? It is overly verbose. The structure would be (assuming you keep it idiomatic) something like [code]<array> <values> <value>1</value> <value>2</value> ... </values> <values> ... </values> ... </array>[/code] You could use a simple [url=https://en.wikipedia.org/wiki/Comma-separated_values]CSV[/url] if you're not looking to serialize anything more complex. Serialization should then be as easy as writing a bunch of numbers and commas to a file. Deserialization is the same thing in reverse. If for some reason you are looking for an existing data interchange format, JSON has direct support for arrays. Something like that should work: [code][ [1,1,0,...], [1,1,1,...], ... ][/code]. If you're set on XML though, [url=https://jaxb.java.net/]JAXB[/url] seems to be the officially endorsed library (or even part of the standard library?). [url=https://jaxb.java.net/2.2.7/docs/ch03.html#annotating-your-classes-mapping-your-favorite-class]Here's some sample code[/url]. For JSON, [url=http://stackoverflow.com/a/785066/1874964]a StackOverflow user suggested Gson[/url]. [url=https://sites.google.com/site/gson/gson-user-guide#TOC-Using-Gson]Sample code[/url] I you don't need it to be human readable, you could also look into binary formats. I believe [url=http://docs.oracle.com/javase/7/docs/api/java/io/Serializable.html]java.io.Serializable[/url] can do that for you. [url=http://www.javapractices.com/topic/TopicAction.do?Id=45]Here's example code a simple Google search gave me[/url]. Didn't check if any of the sample code looks well. Good luck!
[QUOTE=Rayjingstorm;41467274]Alright, I was probably overthinking it. Thanks.[/QUOTE] If you're on a Linux system there's [url=http://en.wikipedia.org/wiki/Inotify]inotify[/url].
Does anyone know any decent examples for data management in games, especially online games where data is controlled mostly on the server side?
[QUOTE=Z_guy;41469251]If you're on a Linux system there's [URL="http://en.wikipedia.org/wiki/Inotify"]inotify[/URL].[/QUOTE] This looks great, but from what I can see the notification is read from a stream which is blocking, meaning I wouldn't be able to control the main function of the daemon (every time I wanted to check if the file was modified I would get hung up by the system call), or I would be back into the "signal interrupting my non-atomic execution" boat again.
[QUOTE=Nigey Nige;41468610]I'm not good at XML. How would I go about doing this?[/QUOTE] Very awkwardly. With pure XML and a 2D-array you'd end up with things like [code]<row> <cell>1</cell> <cell>1</cell> <cell>0</cell> <cell>0</cell> <!-- ... --> </row> <row> <cell>1</cell> <cell>1</cell> <cell>1</cell> <cell>1</cell> <!-- ... --> </row> <!-- ... -->[/code] It's far easier (and better in almost every way), to just store a string like (for example) [code]1,1,0,0,0,0,0,0,0,0,0,0,0; 1,1,1,1,1,1,1,1,1,1,1,1,1; 1,1,0,0,0,1,0,0,1,1,0,0,0;[/code] and to use string split and trim operations to get the values back.
Sorry, you need to Log In to post a reply to this thread.