I'm moving back to C# to do some 3D stuff with XNA.
It's always fun to mix things up :D
Is there a way in Visual Studio (or preferably SharpDevelop) to have a library (not a dll, just the source) in some location on the disk where I can reference it from any project and don't have to copy around the newest version of it as I keep updating it? C# if it makes a difference.
I spent half my day going from motivated to slowly where I am now: unmotivated.
I've been dealing with making sure the Windows code to find a configuration folder worked. Now, it seems MinGW doesn't support Boost's wide characters, and that I need to #define CINTERFACE for the Windows API, and that I need to use deprecated functions since it doesn't support the latest functions. That's fine, but since I'm using CMake I've had to do some hackery to make the MinGW compiler disable those things while letting the MSVC compiler do what it wants. At the end of the day, this:
[code]if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -pedantic-errors -std=c++0x")
if(MINGW)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static")
add_definitions(-DBOOST_NO_STD_WSTRING -DCINTERFACE)
endif()
elseif(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /WX /wd4355 /wd4512")
set(CMAKE_CFG_INTDIR "/")
set(Boost_USE_STATIC_LIBS ON)
endif()[/code]
[cpp] char pathData[MAX_PATH] = {0};
// SHGetFolderPath is deprecated, but MinGW doesn't support it yet.
HRESULT result = SHGetFolderPath(0, CSIDL_LOCAL_APPDATA, NULL, 0,
pathData);
if(SUCCEEDED(result))
{
path += pathData;
boost::replace_all(path, "\\", "/");
}
else
{
throw std::runtime_error(l10n(
"Unable to find a configuration folder, "\
"Use the --config flag."));
}[/cpp]
Ugh.
Recently I've been messing around with Unity, and so far it looks promising! I made this in a few hours... (warning 4 MB gif)
[img]http://dl.dropbox.com/u/4081391/boxes.gif[/img]
If only OpenTK was this easy...
(also the camera is a simple script which smoothly looks at the average position of all the cubes)
[QUOTE=Dlaor-guy;32089272](warning 4 MB gif)[/QUOTE]
That's like saying 'warning I'm going to punch you in the face' and then punch the person in the face.
[QUOTE=C:\;32088301][img]http://puu.sh/57J7[/img]
i am a MASTER at pygame
[editline]3rd September 2011[/editline]
[code]import pygame
import sys
pygame.init()
screen = pygame.display.set_mode((640,480))
running = True
black = (0, 0, 0)
white = (255, 255, 255)
background = pygame.Surface(screen.get_size())
background = background.convert()
background.fill(white)
font = pygame.font.Font(None, 36)
text = font.render("i am a LOT better than you at pygame", 2, (50, 50, 50))
textpos = text.get_rect()
textpos.centerx = background.get_rect().centerx
textpos.centery = background.get_rect().centery
background.blit(text, textpos)
font2 = pygame.font.Font(None, 100)
text2 = font.render(":D", 54, (55, 55, 55))
textpos2 = text.get_rect()
textpos2.centerx = background.get_rect().centerx+100
background.blit(text2, textpos2)
font3 = pygame.font.Font(None, 100)
text3 = font.render(":D", 54, (55, 55, 55))
textpos3 = text.get_rect()
textpos3.centerx = background.get_rect().centerx+100
textpos3.centery = background.get_rect().centery-50
background.blit(text3, textpos3)
screen.blit(background, (0, 0))
[B]pygame.display.flip()[/B]
[B]while running:
event = pygame.event.wait()
if event.type == pygame.QUIT:
running = False
pygame.quit()[/B]
[/code][/QUOTE]
When doing your update loop you should be using get() rather than wait(). Wait sits and waits until there is input, where as get just grabs anything on the event list. Example:
[code]
while running:
for event in pygame.event.get():
if event.type == [B]QUIT[/B]:
running = False
pygame.quit()
[/code]
You will notice here that I've just used QUIT. It is standard in pygame programs to import
[code]
from pygame.locals import *
[/code]
so that pygame.QUIT turns into just QUIT. You might prefer not doing that but if you are ever looking at someone else's code then you know that. I've also bolded pygame.display.flip(), personally I use update(). This is because for update you can pass the function rect's to draw which is useful for optimization. I'm not sure if there is any other reasons to use update() but it's just what the tutorials I've read taught. Also you don't need to reload the font everytime!
I'm going by the name of QuadTree as of now, because I realised quad trees OWN ;p
[video=youtube;DgKr5HZEmHU]http://www.youtube.com/watch?v=DgKr5HZEmHU[/video]
[QUOTE=Nighley;32089850]I'm going by the name of QuadTree as of now, because I realised quad trees OWN ;p
[video=youtube;DgKr5HZEmHU]http://www.youtube.com/watch?v=DgKr5HZEmHU[/video][/QUOTE]
Is the physics engine your own?
[QUOTE=Darwin226;32089898]Is the physics engine your own?[/QUOTE]
yeah, it's a simple Verlet implementation which isn't as accurate as rigid body but good enough
[IMG]http://dl.dropbox.com/u/33076954/3d%20cube%20-%20software.PNG[/IMG]
Software 3d cube. I need to fix depth sorting because quite a bit of the time triangles are drawing over each other, but im pretty sure i know why it doesnt work (because my implementation is shit, thats why)
Edit:
Turned out to be an extremely easy fix, woo
Edit 2:
What should i do next? This is the furthest i ever got with any of the opengl tutorials when i tried (though obviously this isnt opengl), so im not entirely sure what the next step should be
Edit 3:
Probably a model format, then textures
Try to load an .obj file. They can be easily created from blender, and there's plenty of tutorials floating around showing you how to parse them.
[QUOTE=Icedshot;32091425][IMG]http://dl.dropbox.com/u/33076954/3d%20cube%20-%20software.PNG[/IMG]
Software 3d cube. I need to fix depth sorting because quite a bit of the time triangles are drawing over each other, but im pretty sure i know why it doesnt work (because my implementation is shit, thats why)
Edit:
Turned out to be an extremely easy fix, woo
Edit 2:
What should i do next? This is the furthest i ever got with any of the opengl tutorials when i tried (though obviously this isnt opengl), so im not entirely sure what the next step should be
Edit 3:
Probably a model format, then textures[/QUOTE]
Does depth testing work if 2 triangles are intersecting?
[QUOTE=Naelstrom;32091708]Try to load an .obj file. They can be easily created from blender, and there's plenty of tutorials floating around showing you how to parse them.[/QUOTE]
He can use one of my .obj's if he wants.
[url]http://eris.reager.org/m/crossbow.obj[/url]
[url]http://eris.reager.org/m/crossbow.mtl[/url]
I suggest getting the mtl as well as it contains data which is referenced to the obj, but that all depends if you bother to read it.
If you wanna know what the model looks like you can see it here [url]http://eris.reager.org/view.html?obj=/m/crossbow.obj[/url]
[QUOTE=Darwin226;32091866]Does depth testing work if 2 triangles are intersecting?[/QUOTE]
How it works now is it takes the rotated position of the z coordinates for each triangle and gets an average, then compares the average and sorts according to the averages. I dont know know what you mean by work, but no it wont explode the whole thing if theyre intersecting itll just sort according to the above method
[editline]3rd September 2011[/editline]
[QUOTE=EDDY TT;32091924]He can use one of my .obj's if he wants.
[url]http://eris.reager.org/m/crossbow.obj[/url]
[url]http://eris.reager.org/m/crossbow.mtl[/url]
I suggest getting the mtl as well as it contains data which is referenced to the obj, but that all depends if you bother to read it.
If you wanna know what the model looks like you can see it here [url]http://eris.reager.org/view.html?obj=/m/crossbow.obj[/url][/QUOTE]
Thanks :v:
[QUOTE=Icedshot;32091948]Thanks :v:[/QUOTE]
No problem, if you need anything else 3d model wise I've got a whole dump of them in obj format.
[QUOTE=Icedshot;32091948]How it works now is it takes the rotated position of the z coordinates for each triangle and gets an average, then compares the average and sorts according to the averages. I dont know know what you mean by work, but no it wont explode the whole thing if theyre intersecting itll just sort according to the above method[/QUOTE]
You see, I'm asking because if you want the depth testing to truly work you'll have to implement your own interpolation ;)
[QUOTE=Downsider;32081292][img]http://img820.imageshack.us/img820/2343/screenshot2011090218071.png[/img]
Fixed all my bugs! High-five, please.
The client can now start off literally empty, with no assets like animations, scripts, levels, or images, and it can all stream in from the server with no issues. Hoo-rah![/QUOTE]
Marmalade master race, please. High five, mate.
:)
[QUOTE=Dlaor-guy;32089272]Recently I've been messing around with Unity, and so far it looks promising! I made this in a few hours... (warning 4 MB gif)
[img]http://dl.dropbox.com/u/4081391/boxes.gif[/img]
If only OpenTK was this easy...
(also the camera is a simple script which smoothly looks at the average position of all the cubes)[/QUOTE]
What language is Unity in?
[QUOTE=reevezy67;32092095]What language is Unity in?[/QUOTE]
IIRC, it uses C# in script form.
[QUOTE=Darwin226;32092044]You see, I'm asking because if you want the depth testing to truly work you'll have to implement your own interpolation ;)[/QUOTE]
You mean for the two triangles to intersect properly and display like that? Its a bit of a fringe case that doesnt bother me immensely currently, compared to having to write vertices by hand one by one and not having any textures
[QUOTE=Icedshot;32092117]You mean for the two triangles to intersect properly and display like that? Its a bit of a fringe case that doesnt bother me immensely currently, compared to having to write vertices by hand one by one and not having any textures[/QUOTE]
I guess that's a better way to look at it. When I did a software renderer, I started with manual interpolation and it was very slow so it stopped me from developing it further.
But I still think it was pretty good considering there was even shader support (fragment and vertex)
[QUOTE=reevezy67;32092095]What language is Unity in?[/QUOTE]
Their own javascript-variant, C#, or Boo which is a python-like language. It's all CLI under the hood.
[QUOTE=EDDY TT;32092001]No problem, if you need anything else 3d model wise I've got a whole dump of them in obj format.[/QUOTE]
Is this it?
[IMG]http://dl.dropbox.com/u/33076954/is%20this%20it..PNG[/IMG]
Edit:
Runs a bit slow, and i need proper camera movement so i can try and see anything that is going on. I also need to cull polygons because currently it just draws everything
Edit 2:
I had a look at it through a proper obj viewer, apparently there are a few bugs in mine :v:
Actually i think it might just be upside down. Though there definitely isnt anything mean to be connecting the sight and the crossbow like that
Edit 3:
My bad, turns out that vertex indices start from 1, not 0
[IMG]http://dl.dropbox.com/u/33076954/My%20bad.PNG[/IMG]
Edit 4:
Sorry for the huge image spam, guys. Turns out that i was drawing a circle where each vertex was, of radius 1 in addition to drawing the triangle (for debugging, earlier). Obviously this massively increases the draw count and causes an absolute craptonne of lag, not to mention causing the above image to look so.. jaggedy
So, it now runs smoothly, and looks 95% less shit. Its still upside-down though. :v:
[IMG]http://dl.dropbox.com/u/33076954/fixed%20even%20more.PNG[/IMG]
pretty fireworks (and smoke for the trained eyes)
[video=youtube;Frz7X5Vv_Hc]http://www.youtube.com/watch?v=Frz7X5Vv_Hc[/video]
[QUOTE=reevezy67;32092095]What language is Unity in?[/QUOTE]
You can use anything that runs on Mono, so IronPython, IronRuby, [url=http://cobra-language.com/]Cobra[/url], F#, C#, VB, IronJS, Nemerle, IronScheme.
There is also [url=http://www.mono-project.com/Languages]this page[/url] which has a few (though most are dead/missing :/)
[cpp]
void GUIButton::FixTextureAspectRatio()
{
// we have buttons with 1:1, 2:1, 4:1, and 8:1 aspect ratios
// find the closest integer aspect ratio and assign the correct texture
int aspect = (int)(Size.x / Size.y + 0.5f);
int sizes[4] = { 1, 2, 4, 8 };
int diff = 1024;
int s = 1;
for (int i = 0; i < 4; ++i)
{
int d = sizes[i] - aspect;
if (d < 0) d = -d;
if (d < diff)
{
diff = d;
s = sizes[i];
}
}
Texture = TextureCache::LoadOrGet("button" + ToString(s) + ".tga", *renderer);
}
[/cpp]
talk about ugly code
Okay Facepunch, I need your expertise.
I have a 2d game that a couple of friends and I have been working on made in Game Maker.
I've lost all interest in continuing it because it gets messier and messier as I continue to have to use GML.
I would really prefer to code in C#, but I'd like a good engine that would allow me convert it from GML to C# pretty quickly.
I'm not looking for something as simple as Game Maker, though,
I'm just looking for something that's nice to use, quick to develop with, and clean enough that I'll continue to use it. Should I be going with XNA, SFML.NET, SDL.NET, what?
[QUOTE=Gbps;32097853]Okay Facepunch, I need your expertise.
I have a 2d game that a couple of friends and I have been working on made in Game Maker.
I've lost all interest in continuing it because it gets messier and messier as I continue to have to use GML.
I would really prefer to code in C#, but I'd like a good engine that would allow me convert it from GML to C# pretty quickly.
I'm not looking for something as simple as Game Maker, though,
I'm just looking for something that's nice to use, quick to develop with, and clean enough that I'll continue to use it. Should I be going with XNA, SFML.NET, SDL.NET, what?[/QUOTE]
I can't speak for the others but XNA is a really good (imo) framework that is quick to prototype and develop with. It depends how complex your game is, but you shouldn't have a problem with it.
Anyone here use git extensions? When I install it to use plink it fails to find the key. I got the openssh option working but it has this annoying command window popup every time I do something.
No idea why plink isn't working :\. Worked perfectly fine with tortoisegit.
Sorry, you need to Log In to post a reply to this thread.