[code]pStacktrace:
at (wrapper managed-to-native) object.__icall_wrapper_helper_stelem_ref_check (object,object) <0x00004>
at (wrapper managed-to-native) object.__icall_wrapper_helper_stelem_ref_check (object,object) <0xffffffff>
at LawlGame.Objects.mapDrawInsert () <0x000bd>
at LawlGame.Game1.Update () <0x001a8>
at LawlGame.Game1.Run () <0x00040>
at LawlGame.Program.Main (string[]) <0x00032>
at (wrapper runtime-invoke) LawlGame.Program.runtime_invoke_void_object (object,intptr,intptr,intptr) <0xffffffff>
Native stacktrace:
/usr/bin/cli() [0x80ca6e4]
/usr/bin/cli() [0x80f6893]
[0xb77e9410]
[0xb712d767]
[0xb6c31546]
[0xb6c2c901]
[0xb712d561]
[0xb712d2bb]
[0xb712d204]
/usr/bin/cli(mono_runtime_exec_main+0xde) [0x8113b1e]
/usr/bin/cli(mono_runtime_run_main+0x15a) [0x811429a]
/usr/bin/cli(mono_main+0x18c4) [0x80b3524]
/usr/bin/cli() [0x805ad25]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6) [0xb7570bd6]
/usr/bin/cli() [0x805ac61]
Debug info from gdb:
[Thread debugging using libthread_db enabled]
[New Thread 0xb6d38b70 (LWP 32350)]
[New Thread 0xb77d5b70 (LWP 32349)]
0xb77e9422 in __kernel_vsyscall ()
3 Thread 0xb77d5b70 (LWP 32349) 0xb77e9422 in __kernel_vsyscall ()
2 Thread 0xb6d38b70 (LWP 32350) 0xb77e9422 in __kernel_vsyscall ()
* 1 Thread 0xb75276f0 (LWP 32347) 0xb77e9422 in __kernel_vsyscall ()
Thread 3 (Thread 0xb77d5b70 (LWP 32349)):
#0 0xb77e9422 in __kernel_vsyscall ()
#1 0xb76e7736 in nanosleep () from /lib/tls/i686/cmov/libpthread.so.0
#2 0x081a6af8 in ?? ()
#3 0xb76df96e in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#4 0xb7627a4e in clone () from /lib/tls/i686/cmov/libc.so.6
Thread 2 (Thread 0xb6d38b70 (LWP 32350)):
#0 0xb77e9422 in __kernel_vsyscall ()
#1 0xb76e6245 in sem_wait@@GLIBC_2.1 ()
from /lib/tls/i686/cmov/libpthread.so.0
#2 0x0812e199 in ?? ()
#3 0x081527ea in ?? ()
#4 0x081c3062 in ?? ()
#5 0x081e1925 in ?? ()
#6 0xb76df96e in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#7 0xb7627a4e in clone () from /lib/tls/i686/cmov/libc.so.6
Thread 1 (Thread 0xb75276f0 (LWP 32347)):
#0 0xb77e9422 in __kernel_vsyscall ()
#1 0xb76e6f5b in read () from /lib/tls/i686/cmov/libpthread.so.0
#2 0x080ca87e in ?? ()
#3 0x080f6893 in ?? ()
#4 <signal handler called>
#5 0x080a7190 in ?? ()
#6 0xb712d767 in ?? ()
#7 0xb6c31546 in ?? ()
#8 0xb6c2c901 in ?? ()
#9 0xb712d561 in ?? ()
#10 0xb712d2bb in ?? ()
#11 0xb712d204 in ?? ()
#12 0x08113b1e in mono_runtime_exec_main ()
#13 0x0811429a in mono_runtime_run_main ()
#14 0x080b3524 in mono_main ()
#15 0x0805ad25 in ?? ()
#16 0xb7570bd6 in __libc_start_main () from /lib/tls/i686/cmov/libc.so.6
#17 0x0805ac61 in ?? ()
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
Aborted[/code]
Um... What the fuck? This is just a simple console application, why am I getting all this debug nonsense? :gonk:
Because using invalid memory is a crime.
Needs moar code to investigate.
[code]Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
[/code]
Doesn't that explain it?
If not, run it in a debugger or something, I dunno.
The bit I commented out is the evil bit of code crashing my program. :c
[code]internal void mapDrawInsert()
{
for (int i=0; i < world.sizeX; i++)
{
for (int j=0; j < world.sizeY; j++)
{
string farcry;
farcry = ObjMap[i,j];
if (farcry == "x") { }
///if (farcry == "f") { world.mapInsert("f", 1, 1); }
}
}
}[/code]
[QUOTE=esalaka;23915658][code]Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
[/code]
Doesn't that explain it?
If not, run it in a debugger or something, I dunno.[/QUOTE]
It just said there's a fatal error in my program (as far as I can tell). Yes yes, I can see that.
Are you certain that ObjMap is in the bounds of world.sizeX, world.sizeY?
You should rather use i < ObjMap.GetLength(0) and j < ObjMap.GetLength(1) to be safe.
[QUOTE=jA_cOp;23899515]It's got seemingly erratic whitespace, no explicit namespace prefix for the cout symbol, and isn't in code tags :v:
(also doesn't provide the same output as the printf version)[/QUOTE]
Uh what? I was answering the printf question, not trying to correct the cout<< guy :S
Hence the :ninja:, he ninja'd me :downs:
[QUOTE=NorthernGate;23912998]I have a 1000x1000x1 map, currently the only optimization I have in place is limiting any tiles in view being drawn, so say I have an 800x800 window I can draw 51^2 tiles, so I only draw those 51^2 tiles based on the offset of the top-down camera. The other implementation is based on the Z-Value, my system finds the top most opaque tile and makes sure nothing below it is drawn. So with these optimizations I get roughly 400 - 500 on a map with only 1 value of depth, but for every z level I add on top of that I'm basically cutting the framerate in half.[/QUOTE]
51^2 is 2601. Assuming each tile is drawn as a textured quad, drawing 2601 of them should be a breeze for any non-ancient GPU. Even drawing five layers at each tile, for a total of about 13000 quads, should be fast. (For reference, some areas in Unreal Tournament 3 have more than half a million triangles in view, and I still get over 60fps on an nVidia 8800GT.) What kind of framerates do you get? Have you profiled your program to see where the bottlenecks are?
For drawing tiles with multiple "layers", rather than drawing each layer individually, you can use [url=http://www.opengl.org/resources/code/samples/sig99/advanced99/notes/node60.html]multitexturing[/url] to combine several texture layers into a single drawing operation. The number of layers that can be combined depends on the number of texture units the GPU has, which you can get by using glGetIntegerv() to query the GL_MAX_TEXTURE_UNITS_ARB constant. If a tile has more layers than the the GPU's multitexturing supports, you'll still need to do multiple rendering passes, but overall you'll still be rendering far fewer quads.
[QUOTE=Wyzard;23917317]51^2 is 2601. Assuming each tile is drawn as a textured quad, drawing 2601 of them should be a breeze for any non-ancient GPU. Even drawing five layers at each tile, for a total of about 13000 quads, should be fast. (For reference, some areas in Unreal Tournament 3 have more than half a million triangles in view, and I still get over 60fps on an nVidia 8800GT.) What kind of framerates do you get? Have you profiled your program to see where the bottlenecks are?
For drawing tiles with multiple "layers", rather than drawing each layer individually, you can use [url=http://www.opengl.org/resources/code/samples/sig99/advanced99/notes/node60.html]multitexturing[/url] to combine several texture layers into a single drawing operation. The number of layers that can be combined depends on the number of texture units the GPU has, which you can get by using glGetIntegerv() to query the GL_MAX_TEXTURE_UNITS_ARB constant. If a tile has more layers than the the GPU's multitexturing supports, you'll still need to do multiple rendering passes, but overall you'll still be rendering far fewer quads.[/QUOTE]
Well the framerates are decent enough at the moment even with around 5 layers of anything, I get roughly 400 - 600 frames with nothing going on. I'm fairly certain I've caught the cause which is the 3 for loops going at it, I've tried my best to optimize z-rendering, so instead of looping through everything empty at the bottom it starts from the top z-level and moves down until it encounters a fully opaque tile ( which is calculated when I place the tile as to keep it out of loops ) and then stops going through that Cell. Though I'm sure I can cut that down from the 13,000 loops to 2601 if I try out multitexturing, thanks for your help though, I appreciate it
When should a separate class for managing instances of a class, as opposed to static methods of a class be used?
For example if I wanted to manage a list of console commands, would it be better to have static methods (of the ConsoleCommand class) that add and remove the commands from a list or would it be better to have a separate class that handles finding/adding/removing console commands?
How do I go to the next line in fstream?
[editline]08:42PM[/editline]
And skip an integer?
next line in fstream?
Well, I believe the following can work:
[code]
fstream fin("yourfile",ios::in);
string line_one;
getline(fin, line_one); // std::getline is defined in <string>
string line_two;
getline(fin,line_two);
.... etc...
[/code]
I'm not sure what you mean by "skipping an integer."
If your integer is by itself on a line, you can just read over the line and ignore it.
If you have multiple integers or words, etc, on the line, and you want to skip all of the integers, you can read the line in as a string and then iterate over the string copying elements from it to compose a new string. If, during that process, you hit a character that represents a number, you can ignore it. This way you'll have a string stripped of numerical values.
If you want to ignore a certain integer from a file, you can read in all of the values and then ignore that integer.
ie:
[code]
#include <iostream>
#include <sstream>
#include <string>
using namespace std;
int main()
{
fstream fin("my file", ios::in);
string line;
getline(fin,line);
string a;
int b,c,d;
stringstream ss(line); // let's say line contains "abcdefg 1234 1234 1234"
ss>>a>>b>>c>>d;
// you can just ignore one of the integers now.
}
[/code]
[QUOTE=Darkster;23925740]When should a separate class for managing instances of a class, as opposed to static methods of a class be used?
For example if I wanted to manage a list of console commands, would it be better to have static methods (of the ConsoleCommand class) that add and remove the commands from a list or would it be better to have a separate class that handles finding/adding/removing console commands?[/QUOTE]
I always found having a static console class to handle console commands was better.
[QUOTE=Chandler;23913824]Everything probably appears flipped because the xbox uses a PowerPC based processor, which is big endian. Whereas an intel x86/x86_64 based processor is little endian. The reason it's flipped is most likely due to your hex editor loading the file and displaying it as though it were little endian. If you were to reverse the entire file's byte order, you might be able to extract a bit more info.
(Incidentally, Ubisoft most likely has a function or two to automatically reverse the bytes as they are reading while the game is running. It isn't anything complex, and there are many many examples out there. It is also a *very* common practice for AAA studios to do something like this, where data is stored in one format, and optimized for the more popular platform, in this case the Xbox 360 and PS3, which is also big endian)[/QUOTE]
Holy shit! That's really useful. At this point, all I know is that it looks like there's a bunch of parts to one file, the largest one being filled with a series of floats or ints, I'm thinking of pulling one model apart by myself and tinkering with it until I get something that makes sense and looks like the model it's supposed to be in Far Cry 2's map editor. (I already tried using 3d ripper dx to extract, textures come out with messy filenames, and I can't open the .3dr files in Maya)
YAY REVERSE ENGINEERING!
What software do you guys use to make your game Artwork?
I wanted to have a go at making a side scroller like R-Type and wanted to have nice looking ships but up to now i have only made 2d sprites with gimp
Paint.NET
[QUOTE=NovembrDobby;23938201]Paint.NET[/QUOTE]
Can you animate it and stuff like that with pant.net?
[QUOTE=Richy19;23938138]What software do you guys use to make your game Artwork?
I wanted to have a go at making a side scroller like R-Type and wanted to have nice looking ships but up to now i have only made 2d sprites with gimp[/QUOTE]
If you turn [url=http://www.lostgarden.com/2007/04/free-game-graphics-tyrian-ships-and.html]these[/url] sprites sideways, you might be able to get something done :v: (I'm currently using them as well. Tyrian was a fun game, and these sprites are amaaaaazing)
That website also has a bunch of other free art in the public domain, if anyone is interested.
Also, elephant in the room, we're on page 50. Who'll be carrying the torch to v2?
they changed the limit to 5000posts so my guess is it wont nd untill around 125 pages
[QUOTE=Inside;23930622]next line in fstream?
Well, I believe the following can work:
[code]
fstream fin("yourfile",ios::in);
string line_one;
getline(fin, line_one); // std::getline is defined in <string>
string line_two;
getline(fin,line_two);
.... etc...
[/code]
I'm not sure what you mean by "skipping an integer."
If your integer is by itself on a line, you can just read over the line and ignore it.
If you have multiple integers or words, etc, on the line, and you want to skip all of the integers, you can read the line in as a string and then iterate over the string copying elements from it to compose a new string. If, during that process, you hit a character that represents a number, you can ignore it. This way you'll have a string stripped of numerical values.
If you want to ignore a certain integer from a file, you can read in all of the values and then ignore that integer.
ie:
[code]
#include <iostream>
#include <sstream>
#include <string>
using namespace std;
int main()
{
fstream fin("my file", ios::in);
string line;
getline(fin,line);
string a;
int b,c,d;
stringstream ss(line); // let's say line contains "abcdefg 1234 1234 1234"
ss>>a>>b>>c>>d;
// you can just ignore one of the integers now.
}
[/code][/QUOTE]
Thanks man.
[QUOTE=NorthernGate;23935330]I always found having a static console class to handle console commands was better.[/QUOTE]
Thanks
Anyone else ever have problems with tortoise's icons not updating when you commit?
Java question. I need to make a sound that fades in over time. It uses player.setVolume(float). 0 is muted, and 1 is full volume.
I figure the best way to do this is with a for loop:
for (int i=0; i<10; i++) {
player.setVolume(i/10f);
________
}
I need a way to have it wait a certain amount of time before going through the loop again. Any ideas?
Add sleep(x) in your loop.
Or better yet create a Timer class that adds 1 to it's time every second, making sure to get the frametime as well so it's the same no matter the fps. Slap in the following functions: Reset ( resets the timer to 0 ), Pause ( disables the ability to add to the Time variable ), and Fetch ( returns the current time as a float value ).
[QUOTE=high;23951397]Anyone else ever have problems with tortoise's icons not updating when you commit?[/QUOTE]
Just move out of that directory and move back into it again.
Works for Tortoise Git at least.
[QUOTE=NorthernGate;23957037]Or better yet create a Timer class that adds 1 to it's time every second, making sure to get the frametime as well so it's the same no matter the fps. Slap in the following functions: Reset ( resets the timer to 0 ), Pause ( disables the ability to add to the Time variable ), and Fetch ( returns the current time as a float value ).[/QUOTE]
Don't know how :frown:
Having never used computeSpectrum in AS3, how would one use it to detect beats?
Sorry, you need to Log In to post a reply to this thread.