Jump to content




[MC 1.4.7][CC1.481][Version: 1.4.1] CCLights! Bug fix!

peripheral java utility

144 replies to this topic

#101 thanke

  • New Members
  • 8 posts
  • LocationFrance

Posted 08 January 2013 - 08:50 PM

Ok. I'll wait for a new release. Thanks anyway. It's awsome.
Juste a note : can we use it on a server? Cause mine crashes when it starts :
2013-01-08 08:48:53 [SEVERE] [Minecraft] Encountered an unexpected exception NoClassDefFoundError
java.lang.NoClassDefFoundError: asz
at ds.mods.CCLights.Raster.<init>(Raster.java:21)
at ds.mods.CCLights.CCLights.<clinit>(CCLights.java:45)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:414)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300)
at com.google.common.eventbus.EventBus.post(EventBus.java:268)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:140)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300)
at com.google.common.eventbus.EventBus.post(EventBus.java:268)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:83)
at cpw.mods.fml.common.Loader.loadMods(Loader.java:478)
at cpw.mods.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:86)
at cpw.mods.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:345)
at ho.c(DedicatedServer.java:64)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:458)
at fy.run(SourceFile:849)
Caused by: java.lang.ClassNotFoundException: asz
at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:179)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 30 more
Caused by: java.lang.NullPointerException
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at codechicken.core.asm.ClassHeirachyManager.transform(ClassHeirachyManager.java:80)
at cpw.mods.fml.relauncher.RelaunchClassLoader.runTransformers(RelaunchClassLoader.java:222)
at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:171)


#102 columna1

  • Members
  • 65 posts

Posted 09 January 2013 - 10:04 PM

well
I am trying to use this peripheral on my client
newest forge cc 1.81 and everything and minecraft launches
and then it does this:
It freezes and takes up all my ram and all my cpu and it freezes right here in my console:
ive tried launchers and valnila minecraft but it still happens it locks my computer up

2013-01-09 04:02:39 [INFO] [STDOUT] setupTexture: "/dan200/computer/client/termwhite.png", id: 19
2013-01-09 04:02:39 [INFO] [STDOUT] setupTexture: "/dan200/computer/client/termgrey.png", id: 20
2013-01-09 04:02:39 [INFO] [STDOUT] setupTexture: "blocks/Texture.png", id: 21
2013-01-09 04:02:45 [INFO] [STDOUT] Loading CCTurtle v1.481 (rev 834)

Also i have attached the full console log:

Attached Files



#103 Cruor

  • Members
  • 413 posts
  • LocationNorway

Posted 11 January 2013 - 06:17 AM

REALY nice work on the new update Ds :) runs so much more smoothly.
LOVE the linking grids :P
had to test how much more efficient your code was from last time... soooo!

http://puu.sh/1M4k6

Orginal image: http://www.hdwallpap..._headphones.jpg 1920x1080, 604kb
Readable image: 17.7mb(ikr :P)
Render time(includes loading the picture): 15 to 30 minutes

Note that this was with unoptimized drawing code, but loading took atleast 15min(that should be my fault though) :P

#104 ds84182

  • Members
  • 184 posts

Posted 11 January 2013 - 02:19 PM

Now, one thing I am trying to figure out is that why do people freeze up? It's been happening to me too... It will just assume that the port to MC1.46 broke some code.

#105 iownall555

  • Members
  • 54 posts

Posted 12 January 2013 - 07:03 PM

ds84182, I'd hate to be a pain in the ass but I'm having the same freezing issue. Is a fix for it in the works?
The mod looks great though.

#106 mitterdoo

  • Members
  • 30 posts
  • LocationOregon, United States

Posted 30 January 2013 - 04:55 PM

This needs a LOT more rep! My jaw just dropped at the big Windows 7 (8?) screen on a 16-bit game. Very good, will get!)

#107 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 30 January 2013 - 04:58 PM

View Postmitterdoo, on 30 January 2013 - 04:55 PM, said:

This needs a LOT more rep! My jaw just dropped at the big Windows 7 (8?) screen on a 16-bit game. Very good, will get!)
rep means nothing to most.

#108 PixelToast

  • Signature Abuser
  • 2,265 posts
  • Location3232235883

Posted 31 January 2013 - 02:59 AM

minecraft isnt 16 bit >_<

#109 SilverSatin

  • Members
  • 10 posts

Posted 31 January 2013 - 04:57 AM

View Postmitterdoo, on 30 January 2013 - 04:55 PM, said:

This needs a LOT more rep! My jaw just dropped at the big Windows 7 (8?) screen on a 16-bit game. Very good, will get!)
dude :P minecraft isn't 16 bit

#110 iownall555

  • Members
  • 54 posts

Posted 31 January 2013 - 08:37 PM

I think he means the textures.

#111 PixelToast

  • Signature Abuser
  • 2,265 posts
  • Location3232235883

Posted 01 February 2013 - 05:27 AM

the textures are 16x16, not 16 bit :P

#112 diegodan1893

  • Members
  • 164 posts
  • LocationSpain

Posted 01 February 2013 - 10:32 AM

Nice peripheral but I can't use it, Minecraft freezes randomly after I draw something in the screen (some time after drawing, not instantanely).

View PostCruor, on 11 January 2013 - 06:17 AM, said:

REALY nice work on the new update Ds :) runs so much more smoothly.
LOVE the linking grids :P
had to test how much more efficient your code was from last time... soooo!

http://puu.sh/1M4k6

Orginal image: http://www.hdwallpap..._headphones.jpg 1920x1080, 604kb
Readable image: 17.7mb(ikr :P)
Render time(includes loading the picture): 15 to 30 minutes

Note that this was with unoptimized drawing code, but loading took atleast 15min(that should be my fault though) :P

Can you upload the program?

#113 Hulkiedo

  • New Members
  • 2 posts

Posted 01 February 2013 - 04:04 PM

View Postthanke, on 08 January 2013 - 08:50 PM, said:

Ok. I'll wait for a new release. Thanks anyway. It's awsome.
Juste a note : can we use it on a server? Cause mine crashes when it starts :
2013-01-08 08:48:53 [SEVERE] [Minecraft] Encountered an unexpected exception NoClassDefFoundError
java.lang.NoClassDefFoundError: asz
at ds.mods.CCLights.Raster.<init>(Raster.java:21)
at ds.mods.CCLights.CCLights.<clinit>(CCLights.java:45)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:414)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300)
at com.google.common.eventbus.EventBus.post(EventBus.java:268)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:140)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300)
at com.google.common.eventbus.EventBus.post(EventBus.java:268)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:83)
at cpw.mods.fml.common.Loader.loadMods(Loader.java:478)
at cpw.mods.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:86)
at cpw.mods.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:345)
at ho.c(DedicatedServer.java:64)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:458)
at fy.run(SourceFile:849)
Caused by: java.lang.ClassNotFoundException: asz
at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:179)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 30 more
Caused by: java.lang.NullPointerException
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at codechicken.core.asm.ClassHeirachyManager.transform(ClassHeirachyManager.java:80)
at cpw.mods.fml.relauncher.RelaunchClassLoader.runTransformers(RelaunchClassLoader.java:222)
at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:171)

I got the same error. Forge 518

#114 NeverCast

  • Members
  • 400 posts
  • LocationChristchurch, New Zealand

Posted 05 February 2013 - 10:43 AM

I'm getting Freezing, and it's annoying.

My profiler tells me you're calling a native sysTime in your render loop, causing huge latency!
Make sure you're not calling System.currentTimeMillis() or anything similar in any of your rendering code. That seems to be what is killing it.

Also for some reason your renderer is still running while on the main screen.

Please fix this bug, If you don't mind I'm going to pull apart CCLights today and look at the source code, see if I can find the exact line that is killing it, and suggest an alternative.

#115 NeverCast

  • Members
  • 400 posts
  • LocationChristchurch, New Zealand

Posted 05 February 2013 - 11:21 AM

public void renderAModelAt(TileEntityLightGrid tile, double d, double d1, double d2, float f) {
	long startTime = System.nanoTime();

fix it :)

use the float, that's a time offset. (Edit: Don't use any time information, it's not required by the mod in anyway that I can foresee )

Edit:

	  if (this.displist < 0)
	  {
		System.out.println("Creating Display Lists!");

Also avoid making prints in a render call.

Edit 2:
Actually it doesn't seem like you're using these anywhere as they're not public.
Remove all these lines.


long nanoCount = 0L;
long nanoGet = 0L;
...
long startTime = System.nanoTime();
...
System.out.println("Creating Display Lists!");
...

long endTime = System.nanoTime();
this.nanoCount += endTime - startTime;
this.nanoGet += 1L;



That should fix most the lag / freezing issues.

Edit 3:

And for the love of it, why in the world would you need Nano timing precision?
Don't use nano time ever, and be very scarce using millisecond timing as well.
If anything you should have a public static time for each tick since timing should be syncronized per tick, and you certainly don't need nano scale time for that, not to mention nano calls are SLOW.

In future, think " Is it REALLY needed ", and if the answer is maybe, think " Is this going to cause huge latency ".

If not question1 or question2 then
Dont();
end


#116 ds84182

  • Members
  • 184 posts

Posted 05 February 2013 - 12:18 PM

View PostNeverCast, on 05 February 2013 - 11:21 AM, said:

-SNIP-
Thanks. Will be out soon.

#117 tesla1889

  • Members
  • 351 posts
  • LocationSt. Petersburg

Posted 05 February 2013 - 03:31 PM

EDIT: nevermind

#118 NeverCast

  • Members
  • 400 posts
  • LocationChristchurch, New Zealand

Posted 06 February 2013 - 10:58 AM

Still got a large hotspot here ds-

Raster class

public void run() {
    while (this.running)
    {
      HashMap mapcopy = (HashMap)this.map.clone();

Is there a reason you need to copy the hashmap in a while loop? Or at all?

#119 CoolisTheName007

  • Members
  • 304 posts

Posted 06 February 2013 - 11:41 AM

View Postds84182, on 14 December 2012 - 02:22 PM, said:

View PostSoniEx2, on 10 December 2012 - 03:09 AM, said:

View PostCloudy, on 09 December 2012 - 12:30 AM, said:

View PostSoniEx2, on 05 December 2012 - 09:28 AM, said:

Please add the following function to pixel arrays:
pixel.setTableRGB(table)
it would help a lot!

Woah. You're being polite. Who are you and what have you done with the real Soni?
I am the real Soni!

And about setTableRGB: It would be something like table[1,1]=0xFF0000 (to set pixel @ 1,1 to red).
That would make "screens" faster and less laggy to update, and also make my in-game Sega Genesis emulator possible.
I would do something like this:
tVideo = {}
local pixel = peripheral.wrap("back")

local function startup()
  for x=1,16 do
	for y=1,16 do
	  tVideo[x,y]=0x000000 -- set every pixel to black
	end
  end
end


local function update()
  -- update logic
  os.queueEvent("update")
  os.pullEvent("update")
end

startup()
pixel.setTableRGB(tVideo)
while true do
  update()
  pixel.setTableRGB(tVideo)
end
I wish I could do it, but I'm pretty sure I can't transmit a table into a peripheral :(. Mr. Cloud or Mr. Dan+200 could add functionality to ComputerCraft, just don't bug them to death! ;)
Also, I'm working on a new version. I am trying to make monitors multiblock, and I am rendering the Light Grids a different way (Think about the Maps :P). Just a glimpse of the future :D. (Also, 128x128 Light Grids, and the recipe output doubling :D)

It's true you can't add tables, but you can do something I recently did (for something that wasn't released in OCS (later a simpler version was accepted)).
The idea is to pass unpack(t) to the Java-side, and having no tables inside t. t would be something like : t{ x1,y1,r1,g1,b1,x2,y2,r2,g2,b2,...}.
It may seem slightly complicated, but it's the best way to ensure fast drawing of any kind of shape, and would put the effort of drawing algorithms in the Lua-side, where anyone can help.
Here's the code extract:
/**
  * Performs scanDirection in several directions, with the same options;
  * Lua-side arguments:
  *  (
  *   boolean hitMedium, boolean hitEntity, boolean rayTrace,
  *	number x, number y,number z,
  *   (optional) number x2,(optional) number y2,(optional) number z2),
  *   ...
  *  )
  * Lua-side return:
  * @param world
  * @param x
  * @param y
  * @param z
  * @param args
  * @return (lua-side) integer i->serialized Scan in the i-th direction
  * @throws Exception
  */
public static Map scanSeveral(World world, int x, int y, int z, Object[] args) throws Exception{
  Vector org = new Vector(x, y, z);
  Vector dir = new Vector();
  Map<Integer,Map> ret = new HashMap();
  if (!(args.length>=6&&(args[0] instanceof Boolean)&&(args[1] instanceof Boolean)&&(args[2] instanceof Boolean))){
   throw new Exception("invalid arguments: must provide 3 booleans representing options folllowed by sequence of 3D non-zero vector coordinates in the form of  a vararg: (hitMedium,hitEntities,rayTrace,x1,y1,z1,x2,y2,z2,x3...)");
  }
  boolean hitMedium=(Boolean) args[0];
  boolean hitEntities=(Boolean) args[1];
  boolean rayTrace=(Boolean) args[2];
  int i = 0;
  for (i=0;i<args.length-3;i=i+3){
   if (!(args.length-3>=2+i+1 && args[i+3] instanceof Double && args[i+1+3] instanceof Double && args[i+2+3] instanceof Double)){
	throw new Exception("invalid arguments: must provide 3 booleans representing options folllowed by sequence of 3D non-zero vector coordinates in the form of  a vararg: (hitMedium,hitEntities,rayTrace,x1,y1,z1,x2,y2,z2,x3...)");
   }
   Double x_ = (Double) args[i+3];
   Double y_ =(Double) args[i+1+3];
   Double z_ =(Double) args[i+2+3];
   dir.set(x_,y_,z_);
   Scan scan = new Scan(world, org, dir,hitMedium,hitEntities,rayTrace);
   if (scan!=null){
	ret.put(i/3+1,scan.serialize());
   }
   if (i>MAX_REQUESTS){
	throw new Exception("MAX_REQUESTS="+MAX_REQUESTS+" exceeded: requested "+(args.length-3));
   }
  }
  return ret;
}

Btw, it would be cool to have floors made of cc-light blocks->directions for cc-light blocks OR multi-faced light blocks.

#120 tesla1889

  • Members
  • 351 posts
  • LocationSt. Petersburg

Posted 06 February 2013 - 12:50 PM

could support for monitor_touch events be added?





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users