Show Posts
|
|
Pages: [1] 2 3 ... 7
|
|
4
|
Discussions / General Discussions / Re: Getting things Done (Pimping my own blog)
|
on: 2012-02-07 12:50:18
|
@theagentd sounds similar to TDD? heard lots of good things about that but never got around to actually trying it yet. It sounds like an informal version of TDD (and a very sensible approach). The way he describes it, the tests aren't automated. I suppose that is a fairly important distinction from what advocates would call 'proper' TDD. Also the features he describes are relatively large and complex; one might combine the approach he describes with even smaller unit tests precisely defined aspects: for example, he might have specific tests for things like 'off by one pixel' type errors in his fog of war system as well as the program he can run to eyeball test the whole fog of war system. Personally, I've flirted with unit-testing and indeed found it quite useful at times... I could see the benefit of doing it more properly, but haven't quite gone that far. Maybe on the next project...
|
|
|
|
|
5
|
Discussions / General Discussions / Re: Programming language decisions
|
on: 2012-01-26 21:25:06
|
I think Java is the best platform available for most general tasks. It's fairly easy to use and you can produce excellent results in a reasonable time window with a fair amount of work. The resulting programs cover an amazingly wide area like servers, desktops (GUI), games, etc.
I've professionally programmed many years in assembler, C, C++, Pascal/Delphi, Java and even particpated in some 40 years old Fortran programs (that's not so funny). But Java was and is the only platform I see as a really smart tool to produce the software you actually need to, without too many restrictions and crazy hurdles. (I.e. when you've to hunt "memory leaks" in a huge C++ application developed by a team of people including you in several years of work, you'll see that basically C is just another variation of macro assembler and C++ is just an object orientated macro assembler. So, no matter if a byte shifting program in C is 20% or 30% faster than a Java byte shifter, you really don't want to go back normally. And I didn't mention byte shifting accidentidally, because today's software usually is no byte shifter anymore because you've got your hardware or libraries for that. Using the correct algorithms and data structures (Collections) in your application is usually the key for performance.)
By using Java as platform you don't get chained to a certain operating system and still have got a powerful programming language at your hands. Usually as a software developer you're confrontated with certain tasks to solve in software for a certain platform, and the main question is: will you manage to develier the finished product? And for all that Java is the real "Software Swiss Knife" in my experience. It's still a knife, and work will always be work, but it's a smart tool for a good work.
Howgh. :-)
It seems most of what you say applies to C# / Mono, only I'm still not really aware of a way to bring Java code directly to iOS.
|
|
|
|
|
6
|
Discussions / General Discussions / Re: Programming language decisions
|
on: 2012-01-16 18:53:18
|
Visual Studio is really quite good. I wish I had it's debugging features in Eclipse.
Out of curiosity, what debugging features does it have that Eclipse is lacking? I would have thought Eclipse would have been very comparable feature-wise to VS, at least for C#/managed code languages. Especially with Eclipse's more rapid release cycle. Off the top of my head (having not really done much Java for a little while), Eclipse lacks things like 'set next statement' and also isn't so quick to inspect items as you hover over them... tbh I find them both much of a muchness for debugging. C# is IMHO a nicer language: properties, operator overload and delegates were already mentioned, also LINQ, some handy parallel stuff... I wouldn't want to write C# without ReSharper though (mostly because it does stuff similar to what Eclipse, Netbeans etc do for free), and that means not only paying for r# but also getting VS Pro as Express doesn't support extensions IIRC. Sorry to say it, but in practice in terms of getting a game out there, C# seems better... Mono effectively allows you to reach desktop platforms similarly to Java, but also iOS which is not to be sniffed at. I'd like to know what the performance of Monotouch / droid is really like though, since I'll be starting to prototype some iOS stuff soon and it looks like an appealing approach, but Monotouch is another chunk of money to lay down so it would be a shame if that was wasted... Must admit, the culture around C# does feel rather less free... XNA is mostly a nice API, though I do have some reservations.
|
|
|
|
|
8
|
Java Game APIs & Engines / OpenGL Development / Re: Getting out of the stone age - baseline OpenGL functionality
|
on: 2011-12-05 18:38:11
|
just to prove my point - a friend of mine told me he is buying a "IBM T42" Laptop - because he doesnt need anything powerful
Intel Pentium M (Centrino) 1,7 GHz 400 MHz 1 GB 400 MHz DDR1 and ATi Radeon 7500 32 MB -> (which supports OpenGL 1.4)
And when doing 2D games I think of awesome games like Diablo 2 and their requirements - a game that would run on that laptop no problem
It's weaker than my PSP. I'm actually laughing my ass off at him if he's paying for that shit. Is he, and how much? Not everyone is happy to ride the evil-capitalist-conspiracy planned obsolescence train. Also, IBM Thinkpads are well regarded for being pretty reliable machines.
|
|
|
|
|
9
|
Discussions / General Discussions / Re: AMD Open Sources Aparapi!
|
on: 2011-12-02 11:26:38
|
I thought this may as well have some code tags: Here you go. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
| public class Main{
public static class LifeKernel extends Kernel{
private static final int ALIVE = 0xffffff;
private static final int DEAD = 0;
private final int[] imageData;
private final int width;
private final int height;
private int fromBase;
private int toBase;
public LifeKernel(int _width, int _height, BufferedImage _image) { imageData = ((DataBufferInt) _image.getRaster().getDataBuffer()).getData(); width = _width; height = _height; fromBase = height * width; toBase = 0; setExplicit(true); for (int i = width * (height / 2) + width / 10; i < width * (height / 2 + 1) - width / 10; i++) { imageData[i] = LifeKernel.ALIVE; } put(imageData); }
@Override public void run() { int gid = getGlobalId(); int to = gid + toBase; int from = gid + fromBase; int x = gid % width; int y = gid / width;
if ((x == 0 || x == width - 1 || y == 0 || y == height - 1)) { imageData[to] = imageData[from]; } else { int neighbors = (imageData[from - 1] & 1) + (imageData[from + 1] & 1) + (imageData[from - width - 1] & 1) + (imageData[from - width] & 1) + (imageData[from - width + 1] & 1) + (imageData[from + width - 1] & 1) + (imageData[from + width] & 1) + (imageData[from + width + 1] & 1); if (neighbors == 3 || (neighbors == 2 && imageData[from] == ALIVE)) { imageData[to] = ALIVE; } else { imageData[to] = DEAD; }
}
}
public void nextGeneration() { int swap = fromBase; fromBase = toBase; toBase = swap;
execute(width * height); }
}
public static void main(String[] _args) {
JFrame frame = new JFrame("Game of Life"); final int width = Integer.getInteger("width", 1024 + 512);
final int height = Integer.getInteger("height", 768);
final BufferedImage image = new BufferedImage(width, height * 2, BufferedImage.TYPE_INT_RGB);
final LifeKernel lifeKernel = new LifeKernel(width, height, image);
@SuppressWarnings("serial") JComponent viewer = new JComponent(){ @Override public void paintComponent(Graphics g) { if (lifeKernel.isExplicit()) { lifeKernel.get(lifeKernel.imageData); } if (lifeKernel.fromBase == 0) { g.drawImage(image, 0, 0, width, height, 0, 0, width, height, this); } else { g.drawImage(image, 0, 0, width, height, 0, height, width, 2 * height, this); } } };
viewer.setPreferredSize(new Dimension(width, height)); frame.getContentPane().add(viewer); frame.pack(); frame.setVisible(true); frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
long start = System.currentTimeMillis(); long generations = 0; while (true) { lifeKernel.nextGeneration(); viewer.repaint(); generations++; long now = System.currentTimeMillis(); if (now - start > 1000) { frame.setTitle(lifeKernel.getExecutionMode() + " generations per second: " + (generations * 1000.0) / (now - start)); start = now; generations = 0; } }
} }
|
|
|
|
|
|
11
|
Discussions / General Discussions / Re: Releasing a small library
|
on: 2011-11-28 13:21:01
|
all those &@*(# .svn directories that litter every single folder in the checkout Actually, since SVN 1.7 it doesn't use those folders. This is a pretty recent change. http://subversion.apache.org/docs/release-notes/1.7.htmlA key feature of the changes introduced in Subversion 1.7 is the centralization of working copy metadata storage into a single location. Instead of a .svn directory in every directory in the working copy, Subversion 1.7 working copies have just one .svn directory—in the root of the working copy. This directory includes (among other things) an SQLite-backed database which contains all of the metadata Subversion needs for that working copy.
Even though the data is stored in a structured format, the relationships between the data are complex. We highly discourage external tools from modifying the data held in this database, as such modification is likely to result in working copy corruption.
WARNING: It is not safe to copy an SQLite file while it's being accessed via the SQLite libraries. Consequently, duplicating a working copy (using tar, cp, or rsync) that is being accessed by a Subversion process is not supported for Subversion 1.7 working copies, and may cause the duplicate (new) working copy to be created corrupted. (See issue #3596 for details.)
|
|
|
|
|
12
|
Discussions / General Discussions / Re: AMD Open Sources Aparapi!
|
on: 2011-10-15 11:38:57
|
|
I'm just making a little hello world (won't probably have a chance to do much more than that in the next couple of weeks).
I notice that Kernel has various scalar maths methods implemented... I wonder how non-scalar OpenCL primitives and operations could be used. It seems performance will be compromised for things like graphics and physics if these are inaccessible, am I right?
|
|
|
|
|
13
|
Discussions / General Discussions / Re: Using GWT to go from Java to Java Script
|
on: 2011-10-13 14:19:33
|
|
Hi,
Works great in Chrome, I got a little hooked...
I take it that being mobile-friendly is one of your goals with this, so I tried it out on my phone (Moto Defy), and while it works (which is cool) there are a couple of problems. All of these only apply to the phone.
One is that every tap causes the whole canvas element to be momentarily selected, so you see a translucent orange rectangle over the whole game... The first time I ran it it seemed to be stuck on loading, although I looked at the phone again a little later and it was done. I tried it on a different browser and the loading showed steady progress and happened fairly quickly, I seem to remember it not handling going down to dungeon well at some point, but I just gave it another go and it seems ok. Actually, it seems to just become unresponsive fairly randomly... so that's not good. I tried to enable music and it didn't work.
FWIW, the first browser I tried was Miren & the next Boat; AFAIK they are both just different GUIs on the same Android Webkit engine, not sure.
|
|
|
|
|
14
|
Games Center / Archived Projects / Re: Crabs!
|
on: 2011-10-11 23:23:54
|
|
Just gave the version currently linked by the qr code in the first post a quick try on my Defy (which doesn't officially run 2.3).
Framerate starts to drop below 30 (to about 26) with 500 crabs. 1000 crabs is 15fps, 2000 crabs is sitting at about 5-7fps.
|
|
|
|
|
15
|
Discussions / General Discussions / Re: Eclipse vs. Netbeans
|
on: 2011-03-24 13:47:39
|
Emacs?  you are insane! vi is the way to go!  I still chuckle to myself inwardly every time I type 'vi' into launchy to start Visual Studio. Sad, I know. I do use vim occasionally to make small changes to files on a webserver (even though pspad is more comfortable for that really since I never really learnt how to use vim very effectively).
|
|
|
|
|
16
|
Discussions / General Discussions / Re: Go on, ask me anything.
|
on: 2011-03-23 01:34:53
|
Um i just started using Eclipse and i found the short discussion on the set up of eclipse very useful.. So you helped someone :/ Thx.
i'm using the Java Browsing mode and moved the panes to the right where there's empty space.
Myself, I prefer to use shortcuts to bring up browsers which you can then navigate with find-as-you-type search... Ctrl+Shift+T: type browser Ctrl+Shift+R: resource browser (for non-java files) Ctrl+O: member browser Ctrl-3: searches through lots of available options & commands etc. Alt+left/right: navigate back/forward through history of where you've been Alt+Shift+up/down: select progressively larger/smaller logical block from caret. Ctrl+. / Ctrl+,: navigate through annotations (TODOs, warnings, errors etc). As you can possibly gather, I find it beneficial to avoid switching to the mouse unnecessarily (or trying to find a particular thing by reading through lists rather than typing... ugh).
|
|
|
|
|
17
|
Game Development / Newbie & Debugging Questions / Re: LWJGL Beginning
|
on: 2011-03-17 18:18:51
|
So would I not be able to use the old java classes such as Image and ImageIcon while using LWJGL? Not directly. You'll have to get at the actual Image data and take care of setting up GPU memory and transferring it to OpenGL. I'm sure there are examples of that about. I'm not actually familiar with LWJGL; FWIW JOGL has some helper classes for loading textures and such... in fact, the JOGL source might not be such a bad place to look for an example of how to load data from a Java Image into an OpenGL texture.
|
|
|
|
|
19
|
Discussions / General Discussions / Re: Go on, ask me anything.
|
on: 2011-03-16 19:23:02
|
Various dumb implementations of algorithms that didn't scale well such as turrets targeting gidrahs every frame, etc. Quadtree was a crappy choice of collision manager as nearly everything is roughly the same size or smaller - changed that to a cell based collision manager, got loads more performance. I guess I won't bother implementing that octree collision manager then 
|
|
|
|
|
20
|
Discussions / General Discussions / Re: Go on, ask me anything.
|
on: 2011-03-16 00:34:34
|
Hey, Cas is just down the road from me (Farnham). I often go to Basingstoke and shop in Festival Place. There's quite a good sports centre, although I haven't been there for a while. There was a ice rink, which I staggered round a couple of years ago.
I live in Winchester, and often pass through on the train on the way to London... rarely have any reason to actually go to Basingstoke, though. The Anvil (concert hall) is good. I've been around the ice rink a few times in my childhood...
|
|
|
|
|
25
|
Game Development / Newbie & Debugging Questions / Keeping a local disk-based cache of online resources (facebook images)
|
on: 2011-03-07 17:44:08
|
So, I've tried StackOverflow and the facebook dev forum but no-one seems to be helping thus far.  I must admit I could probably have done some more thorough research myself, but it seems like something that someone with the appropriate knowledge might be able to recognise and explain relatively easily (I hope). I suppose if it was all that simple, someone in SO would probably have chimed in. I'm doing some stuff with facebook which means that I want to keep a cache of pictures. I thought that it should be correct to just use URLConnection.setIfModifiedSince() before connecting and then check for a 304 return code, but it seems facebook is using some other HTTP headers rather than last-modified to control caching and in my brief searches I haven't found anything that really helps me understand what or why. I'm pretty naive when it comes to the nitty-gritty of HTTP, but looking at request details in Chrome's network monitor I see various X-* headers which appear to be relevant... More details can be found on the Stack Overflow question, any help here or over there much appreciated.
|
|
|
|
|
27
|
Discussions / Miscellaneous Topics / Re: Want to be linked by my site?
|
on: 2011-01-14 19:32:08
|
table are good div are great for many cases but table are just the best when needing "table like" presentation you can look at that code too Heathen!  I was only partly joking to begin with. I think many of people's objections to tables are because they're caught up in all the orthodox religious fervor, rather than any actually thinking through what matters. For example, separating content and presentation is indeed a good thing... but with a dynamic site the html markup generation is generally separate from the content authoring anyway, so it seems a rather moot point. I won't say CyanPrime should have used tables, but I bet he'd have had less hassle if he did, without needing funny spacer images, or implicit constraints between the width of #sidebar and the left margin of #content... CSS is intensely irritating in many ways, while tables would indeed have expressed the same thing in a way that was clearer to anyone reading the code, easier to edit, etc. Not really a criticism of CyanPrime; you're following 'best practices' apparently. @Topic... maybe if I get my site in a slightly less neglected state then I'll want people to link to it 
|
|
|
|
|
29
|
Game Development / Newbie & Debugging Questions / Re: simple interface within an opengl application
|
on: 2011-01-14 13:07:16
|
His look and feel API actively breaks apps that run swing code outside the EDT! Pretty crazy
Seems crazy in a way, but of course it's better to catch potential errors as soon as possible, and to know when you are doing something wrong... or not to be allowed to do something if it is wrong. It would be even better if they made this feedback come straight from the compiler, but I'm quite grateful for the fail fast approach of Substance.
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|