Ludii Forum
Exception during game creation: java.lang.reflect.InvocationTargetException - Printable Version

+- Ludii Forum (https://ludii.games/forums)
+-- Forum: Problems (https://ludii.games/forums/forumdisplay.php?fid=5)
+--- Forum: Ludii Player Problems (https://ludii.games/forums/forumdisplay.php?fid=6)
+--- Thread: Exception during game creation: java.lang.reflect.InvocationTargetException (/showthread.php?tid=658)



Exception during game creation: java.lang.reflect.InvocationTargetException - dale walton - 07-26-2021

Exception during game creation: java.lang.reflect.InvocationTargetException
What does this error mean?

Got the above error after changing a define that not working correctly, to use

(forEach Direction
Orthogonal
  (between
    (exact 1)
    if:(is Empty (between))
    (apply (add ....))
  )
  (to ...)
 (then ....)

Where the ... were many different attempts to get it to work.
Basically I want to add a second kind of piece to every empty site between where the decision move add occurred, and any other of the mover's pieces at a distance of 2.
(and then set the state of that consequential piece)

My previous code was sometimes adding the same piece twice in a stack...

Using 1.2.4 and 1.2.5 - same.


RE: Exception during game creation: java.lang.reflect.InvocationTargetException - Eric Piette - 07-28-2021

Hi,

I need the .lud file with that error on it to take a look. But that can be a syntax error the compiler was not able to guess or an exception in one of the evaluation of the ludeme. But for both I need the .lud file to take a look with our code. Can you share it?

Regards,
Eric


RE: Exception during game creation: java.lang.reflect.InvocationTargetException - dale walton - 07-28-2021

Yes, but I am busy teaching for the next couple days, and should try to clean it up a little at least, as it is long. I'll leave in the alternative define with a modified name for your comparison...
------------------------------------------------
Cleaning things up, it seemed the new approach was seeking out new problems, so I went back the the old way, and found the way I had written forEach meant that if multiple occurrences were found
each got repeated that number of times. After cleaning that up, the other logic worked. And then after a lot of work to avoid using  the ifAfterwards filter which was making the execution impossibly slow, even for human human play, I arrived at the attached version.

This version works, and logically seems to be (I hope) bug-free.

However, It is still very slow for AI, and screen updates - which probably is due to a bug on your side, unless I am really misusing the language:

First of all, the moves Add and a consequential add move for the secondary piece are working and executing once.  Everything else is executing twice, including a Pre-Decision remember, my checks for win conditions that update piece states, and the addition and removal of marker pieces placed on Edge sites.

Secondly, as that means that each edge marker is a stack of 2 instead of a single piece, the graphic update is slow and in 2 stages, separated by upto a minute, where at first the markers are offset, and the allowed move circles and site indicies are small, and then the markers are aligned and the indicies and move markers are there normal size.  If all that churning weren't going on, perhaps the time would get used better for the AI?


RE: Exception during game creation: java.lang.reflect.InvocationTargetException - Eric Piette - 08-18-2021

I assume since you finished Netted, I do not have to look at that right ?


RE: Exception during game creation: java.lang.reflect.InvocationTargetException - dale walton - 08-18-2021

Right. I changed which ludeme used to find the liberties and that was both more efficient and less buggy.
You probably have better ways to spend your time.

I am assuming that the fix in the new release for the doubled-up diagonals does work for the submitted script.


RE: Exception during game creation: java.lang.reflect.InvocationTargetException - Eric Piette - 08-18-2021

Hi,

We are going to release soon finally, so you will be able to check by yourself :)

Regards,
Eric


RE: Exception during game creation: java.lang.reflect.InvocationTargetException - Alain Busser - 04-19-2024

Hello, I got the same message for Sowing (Conway's game). This happens only on smaller boards (less than 8 holes).

At first I thought it was because there is no ending condition for those variants but I know it is not the case. For example for n==4 I have this initial situation:

2 2 2 2

Only the first holes are playable so I can go to either

0 3 3 2

or

2 0 3 3

In the first case, player 2 can only go to 0 4 4 0 and P1 looses (no playable possibility).

In the second case, player 2 can only go to 3 1 4 0 from which player 1 goes to 3 0 5 0 and wins (player 2 can not play anything).

By the way I could not make (start (set Count 2 to:(sites Top))) work which is why my script is so complicated...

Oops I found the bug, it is the definition of the tracks...

I include the correct file : this game is quite playable and from 3 holes on!