Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (481)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (547)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 [2]
  ignore  |  Print  
  MappedObject library  (Read 8675 times)
0 Members and 1 Guest are viewing this topic.
Offline Roquen
« Reply #30 - Posted 2012-07-23 14:09:01 »

In theory: Jigsaw coupled with the proposed (and AFIK unspecified) lightweight native interface should could be very interesting...too bad we're not going to see it soon.
Offline Danny02
« Reply #31 - Posted 2012-07-23 15:09:24 »

Maven is a symptom of everything wrong with software development in the modern age Smiley

I know that you aren't so fond of all these software design stuff and so on cas, but not everybody is writing only tiny little 1k loc mini games in the world. All this practices which evolved over time might be to big or complicated for some projects, but the nearly all have good ideas behind them. And I would even say that one should start to use them as early as possible.
I get when riven don't want to go through all the hassle to set things up, but it would be a small price to pay to make it for a lot of people easier.

To finish things up, wtf are you talking about maven???
There are alternatives to maven like grandle ... which I did not try yet, but overall it just makes the hole project live-cycle management so much easier. One might have to read 1-2 pages and try it once to understand the basics, but it is just so much easier to use then any other available tool + all the new positive aspects it brings with it.

So that was my little rant for all the "conservative" guys here.

Offline princec

JGO Kernel


Medals: 362
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #32 - Posted 2012-07-23 20:28:18 »

You seem to imply with your statement that I write tiny 1kloc games. (kloc? who uses that metric any more?)

<edit>For your amusement - Revenge of the Titans for example is ~151 kloc excluding the new online stuff we're working on.

Cas Smiley

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Gudradain
« Reply #33 - Posted 2012-07-23 20:56:00 »

Well, when I think about maven I always have the same question in mind : ''Why was Maven invented?"

I read here and there that it makes your project lifecycle a lot easier and it can replace ant, and that ant build are a pain to maintain and that it slow down your project velocity and etc.

But really, what does Maven do that I can't do with Eclipse + a few mouse click + some .bat files?
Offline sproingie

JGO Kernel


Medals: 202



« Reply #34 - Posted 2012-07-23 21:55:47 »

But really, what does Maven do that I can't do with Eclipse + a few mouse click + some .bat files?

Not require the .bat files.  Want to add a dependency on commons-io?  Type FileUtils in an editor in eclipse.  It gets redlined because it doesn't know what that is.  Right click it, say "search for maven dependency" (or whatever it says in eclipse these days).  Find commons-io in the list.  It will download it, the source and javadoc (optionally), add it to your compile and run classpath, and the same for anything it depends on. 

All clicky.  No XML.

Oh but right, REAL MEN do it all by hand.  Whatevs.


Offline Gudradain
« Reply #35 - Posted 2012-07-23 22:30:57 »

Not require the .bat files.  Want to add a dependency on commons-io?  Type FileUtils in an editor in eclipse.  It gets redlined because it doesn't know what that is.  Right click it, say "search for maven dependency" (or whatever it says in eclipse these days).  Find commons-io in the list.  It will download it, the source and javadoc (optionally), add it to your compile and run classpath, and the same for anything it depends on. 

So is that the reason why Maven was invented?

I will assume that for now. Something like that is really a good thing. I would want something that could manage all the external jar I need for my project without having to go download them by hand and that would update the jar for the newest version when I want. That would be really useful for sure. But why doesn't maven only do that? Or is there any plugin or tool out there that only do that?

I don't want maven to create my eclipse project. Eclipse can do it.
I don't want maven to build my jar. Eclipse can do it.
I don't want maven to run my test. Eclipse can do it.

I mean why did they tried to make 1 tool do everything and even worse force you to do everything with that tool? Nobody want that... Everyone like to work his own way.

My question stand, why was maven invented? To force you to do everything with it or to give you the opportunity to automatically download all the jars you need for your project to run?
Offline sproingie

JGO Kernel


Medals: 202



« Reply #36 - Posted 2012-07-23 22:52:00 »

Dependency management is a big reason for Maven's existence, yes.  It also does quite a few other things. 

As for the preference for eclipse, fine.  If you prefer eclipse's layout, change them from the defaults.  No one is "forcing" you to use it at all, let alone use every last feature of it.  Perhaps you should reserve your remaining criticisms of maven until you've learned more about it
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 781
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #37 - Posted 2012-07-24 00:45:21 »

I get when riven don't want to go through all the hassle to set things up, but it would be a small price to pay to make it for a lot of people easier.
Wait, I made a public maven repository, I thought by doing that I actually went through the hassle - believe me, it was. And now you insinuate I didn't bother.

Anyways, I'm willing to tolerate even more of a derailment than this! I'd appreciate it though if we could also discuss mapped objects, while we're at it. Smiley

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline ra4king

JGO Kernel


Medals: 345
Projects: 2
Exp: 5 years


I'm the King!


« Reply #38 - Posted 2012-07-24 03:11:28 »

I'm currently entertaining the idea of making a block-world kind of test game using MappedObjects, where I would have a Block class that's a MappedType. No, not minecraft.
Give me a week to get back to my computer though.

Offline lhkbob

JGO Knight


Medals: 32



« Reply #39 - Posted 2012-07-24 06:34:22 »

Wait, I made a public maven repository, I thought by doing that I actually went through the hassle - believe me, it was. And now you insinuate I didn't bother.
You didn't go through the hassle of getting your library hosted on the Maven central repository (which is managed by Sonatype). It's "nice" to host things on the central repository because all Maven projects will check that location for libraries. With your way, we have to update our own project to use the additional repository Tongue

I use Maven quite a bit with work and really like it, and it sounds like some people have misconceptions or just don't know much about Maven so here's my take on what it can do and why it's cuddly:

Maven is a combined dependency management system and project build/lifecycle manager.  The build system is powerful but can be largely ignored if conventions are followed.  The dependency manager is nice because it forces you to document the exact libraries AND their versions that you depend on. As said before, it will download the JARs for those dependencies, and the JARs of any transitive dependencies, etc.  It will also resolve as best version conflicts between dependencies.

At work before Maven, my classpaths might grow to 50 jars in some of our servers, with libraries I'd never use personally but were a dependency. If I wanted to update Struts or Hibernate, it was a very bug prone hassle to try and get the correct new versions of their dependencies.  This is trivially easy to do with Maven and should not be sneezed at.  I doubt my games will ever need that many dependencies, but it's still nice to have as a feature.

There is a very nice Maven plugin for Eclipse so you still create your project through Eclipse (just a different type than plain Java). Eclipse still does all of the compiling and it can still do its magic classpath sharing between projects (even other Maven ones in your workspace). The plugin will automatically download the Javadocs and source associated with a dependency when you go to inspect an element, and links it for you into the normal Eclipse source inspection system.

By the time you need to build your final application, you might have to mess with some XML funny business, but there's a good chance you'd have done that with ant.  Maven has much better fat-jar support compared with Eclipse.

IMO Maven helps keep your own projects more modularized because you can split them into separate modules. Do you have custom math functions and vectors, etc. It's a module. Physics library or helper code; it's a module. Input system or event system, or core AI routines? Module. Then you can have them depend on each other as needed, and have a last module that brings them all together and implements your game.

Want to make a new game, just pull in your modules you want to reuse instead of trying to gut pieces by hand.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 781
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #40 - Posted 2012-07-24 06:44:18 »

Surely Maven is a nice tool that solves every problem imaginable, but that doesn't mean I have to put even more hours into supporting it than I already did. Add a <repository> to your POM and stop whining. If that's too much effort, maybe this lib is not for you.

(btw: 'you' in the general term, not anybody in particular)

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline gimbal

JGO Knight


Medals: 25



« Reply #41 - Posted 2012-07-24 11:42:41 »

Surely Maven is a nice tool that solves every problem imaginable, but that doesn't mean I have to put even more hours into supporting it than I already did. Add a <repository> to your POM and stop whining. If that's too much effort, maybe this lib is not for you.

You did all you need to do dude, there is absolutely no need at all to have stuff in Maven Central. If people have a problem with having to copy/paste the repository declaration to each project, just slap it in your user specific settings.xml to have it available for all projects at once. Of course that is less portable, but I have this idea that for most people using this library the portability isn't really an issue.
Offline Roquen
« Reply #42 - Posted 2012-07-24 12:32:17 »

When I look at stuff like Maven I think to myself: "Wow! I could spend hours setting up a new tool and learning the basics so I can save myself minutes before something new-better-faster, yada-yada-yada comes along to replace it.  Pass."

[OnTopicMode]

Distant food for thought: data segregation via allowing breaking into multiple buffers.

@MappedField(stream = 0, offset = 0)  ...
@MappedField(stream = 1, offset = 0)  ...

[/OnTopicMode]
Offline princec

JGO Kernel


Medals: 362
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #43 - Posted 2012-07-24 12:33:24 »

Hmmm interesting so you'd actually back a mapped object by several bytebuffers?

Cas Smiley

Offline Riven
« League of Dukes »

JGO Overlord


Medals: 781
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #44 - Posted 2012-07-24 12:40:13 »

Possibilities: endless
Available time: limited
Users: zero

 Emo

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline Roquen
« Reply #45 - Posted 2012-07-24 12:41:57 »

@Cas: Yeah.  Data-flow optimizations is the thought.  Manual segregation is a total nightmare, but if you could rework in a couple of keystrokes..win!

@Riven: What I figured.
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 781
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #46 - Posted 2012-07-24 12:44:44 »

@Cas: Yeah.  Data-flow optimizations is the thought.  Manual segregation is a total nightmare, but if you could rework in a couple of keystrokes..win!

You can actually pretty much fake it, if you know/restrict the maximum data size:

1  
2  
3  
4  
5  
6  
7  
@MappedField(offset=0) public float x;
@MappedField(offset=4) public float y;
@MappedField(offset=8) public float z;

@MappedField(offset=0+1024*1024) public float r;
@MappedField(offset=4+1024*1024) public float g;
@MappedField(offset=8+1024*1024) public float b;


Althought it would be hardcoded per type instead of per instance.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline Roquen
« Reply #47 - Posted 2012-07-24 12:57:22 »

Good point.
Offline matheus23

JGO Kernel


Medals: 106
Projects: 3


You think about my Avatar right now!


« Reply #48 - Posted 2012-07-24 13:04:42 »

Users: zero

 Emo
I'm pretty sure I might use this... It is soooo awesome ! Cheesy
c'mon Riven, there will be lots of guys using this (I truly believe).

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline princec

JGO Kernel


Medals: 362
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #49 - Posted 2012-07-24 13:17:58 »

hmm maybe he should wait and see how people use it as it is before working any more on it eh? In the meantime there are more useful things our erstwhile slave can do like implement some sort of PHP kitchen sink in the forum.

Cas Smiley

Offline Roquen
« Reply #50 - Posted 2012-07-24 13:36:29 »

Well component based kids should be interested.  But breaking up into some number of fixed sized chunks is really a reasonable solution.
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 781
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #51 - Posted 2012-07-24 13:42:10 »

It's actually not that difficult:

Currently (float) field-access is rewritten to:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
// in:
public class Vec3
{
    public float x, y, z;
}

// out:
public class Vec3
{
    public long address;
}

// access of field:
 Unsafe.getFloat(this.address + field.offset)



When supporting 'streams', it would be:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
// in:
public class Vec3
{
    public float x, y, z;
}

// out:
public class Vec3
{
    public long xAddress, yAddress, zAddress;
}

// access of field:
 Unsafe.getFloat(this.*Address)


Obviously this can't work (fast) in a MappedObjectArray, because I would have to move N pointers when calling .index(i) on a mapped type with N fields.

It works just fine with MappedObject though, but memory overhead becomes considerable, as the instances containing the offsets would easily become bigger than the data it refers to.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline concerto49

Junior Member





« Reply #52 - Posted 2013-01-12 02:43:44 »

Any chance of ASM 4 support?

High performance, fast network, affordable price VPS - Cloud Shards
Available in Texas, New York & Los Angeles
Need a VPS Upgrade?
Pages: 1 [2]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

atombrot (26 views)
2014-08-19 09:29:53

Tekkerue (24 views)
2014-08-16 06:45:27

Tekkerue (23 views)
2014-08-16 06:22:17

Tekkerue (13 views)
2014-08-16 06:20:21

Tekkerue (20 views)
2014-08-16 06:12:11

Rayexar (58 views)
2014-08-11 02:49:23

BurntPizza (38 views)
2014-08-09 21:09:32

BurntPizza (30 views)
2014-08-08 02:01:56

Norakomi (37 views)
2014-08-06 19:49:38

BurntPizza (67 views)
2014-08-03 02:57:17
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!